8
8
9
9
jobs :
10
10
test-return :
11
+ name : ' Integration test: return'
11
12
runs-on : ubuntu-latest
12
13
steps :
13
14
- uses : actions/checkout@v3
@@ -18,26 +19,34 @@ jobs:
18
19
result-encoding : string
19
20
input-value : output
20
21
- 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}}"
22
26
exit 1
23
27
fi
28
+ echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
24
29
25
30
test-relative-require :
31
+ name : ' Integration test: relative-path require'
26
32
runs-on : ubuntu-latest
27
33
steps :
28
34
- uses : actions/checkout@v3
29
- - id : output-set
35
+ - id : relative-require
30
36
uses : ./
31
37
with :
32
38
script : return require('./package.json').name
33
39
result-encoding : string
34
- input-value : output
35
40
- 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}}"
37
44
exit 1
38
45
fi
46
+ echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
39
47
40
48
test-npm-require :
49
+ name : ' Integration test: npm package require'
41
50
runs-on : ubuntu-latest
42
51
steps :
43
52
- uses : actions/checkout@v3
@@ -47,13 +56,16 @@ jobs:
47
56
key : ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
48
57
restore-keys : ${{runner.os}}-npm-
49
58
- run : npm ci
50
- - id : output-set
59
+ - id : npm-require
51
60
uses : ./
52
61
with :
53
62
script : return require('@actions/core/package.json').name
54
63
result-encoding : string
55
- input-value : output
56
64
- 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}}"
58
69
exit 1
59
70
fi
71
+ echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
0 commit comments