Skip to content

Commit e962c54

Browse files
committed
Test success with output
1 parent 4624987 commit e962c54

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/test.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test output
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
matrix:
8+
runs-on: ubuntu-24.04
9+
name: Matrix
10+
timeout-minutes: 15
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
version:
16+
- '1'
17+
- '2'
18+
- '3'
19+
20+
outputs:
21+
success: ${{ steps.success.outputs.success }}
22+
23+
steps:
24+
- id: success
25+
run: echo "::set-output name=success::true"
26+
27+
error:
28+
runs-on: ubuntu-24.04
29+
name: Error
30+
timeout-minutes: 15
31+
32+
steps:
33+
- run: 'false'
34+
35+
success:
36+
runs-on: ubuntu-24.04
37+
name: Success
38+
timeout-minutes: 15
39+
if: always()
40+
needs:
41+
- matrix
42+
- error
43+
44+
steps:
45+
- run: echo ${{ needs.matrix.outputs.success }}
46+
- run: '[[ "${{ needs.matrix.outputs.success-1 }}" == "true" ]]'
47+
- run: '[[ "${{ needs.matrix.outputs.success-2 }}" == "true" ]]'
48+
- run: '[[ "${{ needs.matrix.outputs.success-3 }}" == "true" ]]'
49+
- run: '[[ "${{ needs.error.outputs.success }}" == "true" ]]'

0 commit comments

Comments
 (0)