@@ -37,7 +37,7 @@ class ManifestsToReportTest : FunSpec({
3737 """ .trimIndent()
3838
3939 // when
40- val (isValid, report) = manifestsToReport(Path ("action.yml"), manifest , typesManifest)
40+ val (isValid, report) = manifestsToReport(Pair (manifest, Path ("action.yml")) , typesManifest)
4141
4242 // then
4343 assertSoftly {
@@ -97,7 +97,7 @@ class ManifestsToReportTest : FunSpec({
9797 """ .trimIndent()
9898
9999 // when
100- val (isValid, report) = manifestsToReport(Path ("action.yml"), manifest , typesManifest)
100+ val (isValid, report) = manifestsToReport(Pair (manifest, Path ("action.yml")) , typesManifest)
101101
102102 // then
103103 assertSoftly {
@@ -136,7 +136,7 @@ class ManifestsToReportTest : FunSpec({
136136 val typesManifest = " "
137137
138138 // when
139- val (isValid, report) = manifestsToReport(Path ("action.yml"), manifest , typesManifest)
139+ val (isValid, report) = manifestsToReport(Pair (manifest, Path ("action.yml")) , typesManifest)
140140
141141 // then
142142 assertSoftly {
@@ -170,7 +170,7 @@ class ManifestsToReportTest : FunSpec({
170170 val typesManifest = " #"
171171
172172 // when
173- val (isValid, report) = manifestsToReport(Path ("action.yml"), manifest , typesManifest)
173+ val (isValid, report) = manifestsToReport(Pair (manifest, Path ("action.yml")) , typesManifest)
174174
175175 // then
176176 assertSoftly {
@@ -218,7 +218,7 @@ class ManifestsToReportTest : FunSpec({
218218 """ .trimIndent()
219219
220220 // when
221- val (isValid, report) = manifestsToReport(Path ("action.yml"), manifest , typesManifest)
221+ val (isValid, report) = manifestsToReport(Pair (manifest, Path ("action.yml")) , typesManifest)
222222
223223 // then
224224 assertSoftly {
@@ -278,7 +278,7 @@ class ManifestsToReportTest : FunSpec({
278278 """ .trimIndent()
279279
280280 // when
281- val (isValid, report) = manifestsToReport(Path ("action.yml"), manifest , typesManifest)
281+ val (isValid, report) = manifestsToReport(Pair (manifest, Path ("action.yml")) , typesManifest)
282282
283283 // then
284284 assertSoftly {
@@ -308,4 +308,72 @@ class ManifestsToReportTest : FunSpec({
308308 """ .trimIndent()
309309 }
310310 }
311+
312+ test("no action manifest") {
313+ // when
314+ val typesManifest = """
315+ inputs:
316+ foo:
317+ type: boolean
318+ baz:
319+ type: enum
320+ allowed-values:
321+ - foo
322+ - bar
323+ outputs:
324+ goo:
325+ type: boolean
326+ boo:
327+ type: enum
328+ """ .trimIndent()
329+
330+ // when
331+ val (isValid, report) = manifestsToReport(null, typesManifest)
332+
333+ // then
334+ assertSoftly {
335+ isValid shouldBe false
336+ report shouldBe " No action manifest (action.yml or action.yaml) found!"
337+ }
338+ }
339+
340+ test("no types manifest") {
341+ // when
342+ val manifest = """
343+ name: GitHub Actions Typing
344+ description: Bring type-safety to your GitHub actions' API!
345+ author: Piotr Krzemiński
346+ inputs:
347+ verbose:
348+ description: 'Set to true to display debug information helpful when troubleshooting issues with this action.'
349+ required: false
350+ default: 'false'
351+ someEnum:
352+ description: 'Testing enum'
353+ required: false
354+ runs:
355+ using: 'docker'
356+ image: 'Dockerfile'
357+ """ .trimIndent()
358+
359+ // when
360+ val (isValid, report) = manifestsToReport(Pair (manifest, Path ("action.yml")), null)
361+
362+ // then
363+ assertSoftly {
364+ isValid shouldBe false
365+ report shouldBe " No types manifest (action-types.yml or action-types.yaml) found!"
366+ }
367+ }
368+
369+ test("no action manifest and types manifest") {
370+ // when
371+ val (isValid, report) = manifestsToReport(null, null)
372+
373+ // then
374+ assertSoftly {
375+ isValid shouldBe false
376+ report shouldBe " No action manifest (action.yml or action.yaml) found!"
377+ }
378+ }
311379})
0 commit comments