88
99jobs :
1010 test-return :
11+ name : ' Integration test: return'
1112 runs-on : ubuntu-latest
1213 steps :
1314 - uses : actions/checkout@v3
@@ -18,26 +19,34 @@ jobs:
1819 result-encoding : string
1920 input-value : output
2021 - run : |
21- if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then
22+ echo "- Validating output is produced"
23+ expected="output"
24+ if [[ "${{steps.output-set.outputs.result}}" != "$expected" ]]; then
25+ echo $'::error::\u274C' "Expected '$expected', got ${{steps.output-set.outputs.result}}"
2226 exit 1
2327 fi
28+ echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
2429
2530 test-relative-require :
31+ name : ' Integration test: relative-path require'
2632 runs-on : ubuntu-latest
2733 steps :
2834 - uses : actions/checkout@v3
29- - id : output-set
35+ - id : relative-require
3036 uses : ./
3137 with :
3238 script : return require('./package.json').name
3339 result-encoding : string
34- input-value : output
3540 - run : |
36- if [[ "${{steps.output-set.outputs.result}}" != "github-script" ]]; then
41+ echo "- Validating relative require output"
42+ if [[ "${{steps.relative-require.outputs.result}}" != "github-script" ]]; then
43+ echo $'::error::\u274C' "Expected '$expected', got ${{steps.relative-require.outputs.result}}"
3744 exit 1
3845 fi
46+ echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
3947
4048 test-npm-require :
49+ name : ' Integration test: npm package require'
4150 runs-on : ubuntu-latest
4251 steps :
4352 - uses : actions/checkout@v3
@@ -47,13 +56,16 @@ jobs:
4756 key : ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
4857 restore-keys : ${{runner.os}}-npm-
4958 - run : npm ci
50- - id : output-set
59+ - id : npm-require
5160 uses : ./
5261 with :
5362 script : return require('@actions/core/package.json').name
5463 result-encoding : string
55- input-value : output
5664 - run : |
57- if [[ "${{steps.output-set.outputs.result}}" != "@actions/core" ]]; then
65+ echo "- Validating npm require output"
66+ expected="@actions/core"
67+ if [[ "${{steps.npm-require.outputs.result}}" != "$expected" ]]; then
68+ echo $'::error::\u274C' "Expected '$expected', got ${{steps.npm-require.outputs.result}}"
5869 exit 1
5970 fi
71+ echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
0 commit comments