diff options
Diffstat (limited to 'pkg/runner/testdata/uses-composite-with-pre-and-post-steps')
9 files changed, 57 insertions, 0 deletions
diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/action.yml b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/action.yml new file mode 100644 index 0000000..63be798 --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/action.yml @@ -0,0 +1,13 @@ +name: "Action with pre and post" +description: "Action with pre and post" + +inputs: + step: + description: "step" + required: true + +runs: + using: "node16" + pre: pre.js + main: main.js + post: post.js diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/main.js b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/main.js new file mode 100644 index 0000000..21dd65b --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/main.js @@ -0,0 +1,3 @@ +const { appendFileSync } = require('fs'); +const step = process.env['INPUT_STEP']; +appendFileSync(process.env['GITHUB_ENV'], `;${step}`, { encoding:'utf-8' }) diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/post.js b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/post.js new file mode 100644 index 0000000..d3fff73 --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/post.js @@ -0,0 +1,3 @@ +const { appendFileSync } = require('fs'); +const step = process.env['INPUT_STEP']; +appendFileSync(process.env['GITHUB_ENV'], `;${step}-post`, { encoding:'utf-8' }) diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/pre.js b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/pre.js new file mode 100644 index 0000000..b17cb69 --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/pre.js @@ -0,0 +1 @@ +console.log('pre'); diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/composite_action/action.yml b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/composite_action/action.yml new file mode 100644 index 0000000..2d12207 --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/composite_action/action.yml @@ -0,0 +1,12 @@ +name: "Test Composite Action" +description: "Test action uses composite" + +runs: + using: "composite" + steps: + - uses: ./uses-composite-with-pre-and-post-steps/action-with-pre-and-post + with: + step: step1 + - uses: ./uses-composite-with-pre-and-post-steps/action-with-pre-and-post + with: + step: step2 diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/action.yml b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/action.yml new file mode 100644 index 0000000..1ba0fc6 --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/action.yml @@ -0,0 +1,7 @@ +name: "last action check" +description: "last action check" + +runs: + using: "node16" + main: main.js + post: post.js diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/main.js b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/main.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/main.js diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/post.js b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/post.js new file mode 100644 index 0000000..bc6d7ed --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/last-action/post.js @@ -0,0 +1,7 @@ +const output = process.env['STEP_OUTPUT_TEST']; +const expected = 'empty;step1;step2;step2-post;step1-post'; + +console.log(output); +if (output !== expected) { + throw new Error(`Expected '${expected}' but got '${output}'`); +} diff --git a/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/push.yml b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/push.yml new file mode 100644 index 0000000..922d38a --- /dev/null +++ b/pkg/runner/testdata/uses-composite-with-pre-and-post-steps/push.yml @@ -0,0 +1,11 @@ +name: uses-composite-with-pre-and-post-steps +on: push + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: ./uses-composite-with-pre-and-post-steps/last-action + - uses: actions/checkout@v2 + - run: echo -n "STEP_OUTPUT_TEST=empty" >> $GITHUB_ENV + - uses: ./uses-composite-with-pre-and-post-steps/composite_action |