Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 806be26

Browse filesBrowse files
committed
Clean and spruce up the integration tests a bit
- Use test-specific step ids - Remove unused input parameters - Provide clear output on what passed or failed, including a step summary for each passed test.
1 parent 8d76c9a commit 806be26
Copy full SHA for 806be26

File tree

Expand file treeCollapse file tree

1 file changed

+19
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-7
lines changed

‎.github/workflows/integration.yml

Copy file name to clipboardExpand all lines: .github/workflows/integration.yml
+19-7Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.