-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for checking invalid keys under
runs
in action.yml
- Loading branch information
Showing
31 changed files
with
192 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/workflows/test\.yaml:7:15: "node14" runner at "runs.using" is unavailable since the Node\.js version is too old \(14 < 16\) in local action "Old Node\.js" defined at "\./old_node"\. see https://.+ \[action\]/ | ||
/workflows/test\.yaml:8:15: "runs\.using" is missing in local action "Missing runner name" defined at "\./missing_runner" \[action\]/ | ||
/workflows/test\.yaml:9:15: invalid runner name "what-is-this-runner" at runs\.using in local action "Unknown runner name" defined at "\./unknown_runner"\. see https://.+ to know valid runner names \[action\]/ | ||
/workflows/test\.yaml:10:15: invalid runner name "nodenext" at runs\.using in local action "Invalid node version" defined at "\./invalid_node_version"\. see https://.+ to know valid runner names \[action\]/ | ||
workflows/test.yaml:8:15: "runs.using" is missing in local action "Missing runner name" defined at "./missing_runs" [action] | ||
workflows/test.yaml:9:15: "runs.using" is missing in local action "No using" defined at "./missing_using" [action] | ||
/workflows/test\.yaml:10:15: invalid runner name "what-is-this-runner" at runs\.using in local action "Unknown runner name" defined at "\./unknown_runner"\. see https://.+ to know valid runner names \[action\]/ | ||
/workflows/test\.yaml:11:15: invalid runner name "nodenext" at runs\.using in local action "Invalid node version" defined at "\./invalid_node_version"\. see https://.+ to know valid runner names \[action\]/ |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
testdata/projects/local_action_invalid_runners/missing_using/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: 'No using' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: '"using" is required' | ||
|
||
runs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
workflows/test.yaml:8:15: "steps" is required in "runs" section because "Composite action" is a Composite action. the action is defined at "./missing_steps" [action] | ||
workflows/test.yaml:9:15: "main" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "pre" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "pre-if" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "post" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "post-if" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "image" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "pre-entrypoint" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "entrypoint" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "post-entrypoint" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "args" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:9:15: "env" is not allowed in "runs" section because "Composite action" is a Composite action. the action is defined at "./all_invalid_keys" [action] |
20 changes: 20 additions & 0 deletions
20
testdata/projects/local_composite_action/all_invalid_keys/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Composite action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct composite action' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- run: echo hello | ||
main: index.js | ||
pre: pre.js | ||
pre-if: true | ||
post: post.js | ||
post-if: true | ||
image: 'docker://debian:stretch-slim' | ||
pre-entrypoint: pre.sh | ||
entrypoint: main.sh | ||
post-entrypoint: post.sh | ||
args: [foo, bar] | ||
env: | ||
FOO: BAR |
6 changes: 6 additions & 0 deletions
6
testdata/projects/local_composite_action/missing_steps/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: 'Composite action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct composite action' | ||
|
||
runs: | ||
using: 'composite' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./ok | ||
- uses: ./missing_steps | ||
- uses: ./all_invalid_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
workflows/test.yaml:10:15: "image" is required in "runs" section because "Docker action" is a Docker action. the action is defined at "./missing_image" [action] | ||
workflows/test.yaml:11:15: "main" is not allowed in "runs" section because "Docker action" is a Docker action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:11:15: "pre" is not allowed in "runs" section because "Docker action" is a Docker action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:11:15: "pre-if" is not allowed in "runs" section because "Docker action" is a Docker action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:11:15: "post" is not allowed in "runs" section because "Docker action" is a Docker action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:11:15: "post-if" is not allowed in "runs" section because "Docker action" is a Docker action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:11:15: "steps" is not allowed in "runs" section because "Docker action" is a Docker action. the action is defined at "./all_invalid_keys" [action] |
14 changes: 14 additions & 0 deletions
14
testdata/projects/local_docker_action/all_invalid_keys/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: 'Docker action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct Docker action' | ||
|
||
runs: | ||
using: 'docker' | ||
image: 'docker://debian:stretch-slim' | ||
main: index.js | ||
pre: pre.js | ||
pre-if: true | ||
post: post.js | ||
post-if: true | ||
steps: | ||
- run: echo hello |
6 changes: 6 additions & 0 deletions
6
testdata/projects/local_docker_action/missing_image/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: 'Docker action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct Docker action' | ||
|
||
runs: | ||
using: 'docker' |
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
testdata/projects/local_docker_action/ok_all_keys/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'Docker action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct Docker action' | ||
|
||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
pre-entrypoint: pre.sh | ||
entrypoint: main.sh | ||
post-entrypoint: post.sh | ||
args: [foo, bar] | ||
env: | ||
FOO: BAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM alpine:latest |
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
testdata/projects/local_docker_action/ok_registry/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: 'Docker action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct Docker action' | ||
|
||
runs: | ||
using: 'docker' | ||
image: 'docker://debian:stretch-slim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./ok_dockerfile | ||
- uses: ./ok_registry | ||
- uses: ./ok_all_keys | ||
- uses: ./missing_image | ||
- uses: ./all_invalid_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
workflows/test.yaml:9:15: "main" is required in "runs" section because "JavaScript action" is a JavaScript action. the action is defined at "./missing_main" [action] | ||
workflows/test.yaml:9:15: "main" is required in "runs" section because "JavaScript action" is a JavaScript action. the action is defined at "./missing_main" [action] | ||
workflows/test.yaml:10:15: "steps" is not allowed in "runs" section because "Composite action" is a JavaScript action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:10:15: "image" is not allowed in "runs" section because "Composite action" is a JavaScript action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:10:15: "pre-entrypoint" is not allowed in "runs" section because "Composite action" is a JavaScript action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:10:15: "entrypoint" is not allowed in "runs" section because "Composite action" is a JavaScript action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:10:15: "post-entrypoint" is not allowed in "runs" section because "Composite action" is a JavaScript action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:10:15: "args" is not allowed in "runs" section because "Composite action" is a JavaScript action. the action is defined at "./all_invalid_keys" [action] | ||
workflows/test.yaml:10:15: "env" is not allowed in "runs" section because "Composite action" is a JavaScript action. the action is defined at "./all_invalid_keys" [action] |
16 changes: 16 additions & 0 deletions
16
testdata/projects/local_javascript_action/all_invalid_keys/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Composite action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct composite action' | ||
|
||
runs: | ||
using: node20 | ||
main: index.js | ||
steps: | ||
- run: echo hello | ||
image: 'docker://debian:stretch-slim' | ||
pre-entrypoint: pre.sh | ||
entrypoint: main.sh | ||
post-entrypoint: post.sh | ||
args: [foo, bar] | ||
env: | ||
FOO: BAR |
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
testdata/projects/local_javascript_action/missing_main/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: 'JavaScript action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct JavaScript action' | ||
|
||
runs: | ||
using: node20 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
11 changes: 11 additions & 0 deletions
11
testdata/projects/local_javascript_action/ok_all_optional/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: 'JavaScript action' | ||
author: 'rhysd <https://rhysd.github.io>' | ||
description: 'Correct JavaScript action' | ||
|
||
runs: | ||
using: node20 | ||
main: index.js | ||
pre: pre.js | ||
pre-if: true | ||
post: pre.js | ||
post-if: true |
1 change: 1 addition & 0 deletions
1
testdata/projects/local_javascript_action/ok_all_optional/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
1 change: 1 addition & 0 deletions
1
testdata/projects/local_javascript_action/ok_all_optional/post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
1 change: 1 addition & 0 deletions
1
testdata/projects/local_javascript_action/ok_all_optional/pre.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
10 changes: 10 additions & 0 deletions
10
testdata/projects/local_javascript_action/workflows/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./ok | ||
- uses: ./ok_all_optional | ||
- uses: ./missing_main | ||
- uses: ./all_invalid_keys |