-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (76 loc) · 2.3 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
runners:
runs-on: ubuntu-latest
outputs:
all: ${{ steps.list.outputs.all }}
windows: ${{ steps.list.outputs.windows }}
steps:
- id: list
uses: snow-actions/[email protected]
test-bash:
needs: [ runners ]
strategy:
fail-fast: false
matrix:
# Runs on all supported runners
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runner: ${{ fromJSON(needs.runners.outputs.all) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 5
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- id: without-parameters
uses: ./
- run: test "${GREET}" = "Hello World"
env:
GREET: ${{ steps.without-parameters.outputs.greet }}
- run: test "$(cat greet.txt)" = "Hello World"
- id: with-parameters
uses: ./
with:
who-to-greet: composite action
- run: test "${GREET}" = "Hello composite action"
env:
GREET: ${{ steps.with-parameters.outputs.greet }}
- run: test "$(cat greet.txt)" = "Hello composite action"
test-powershell:
needs: [ runners ]
strategy:
fail-fast: false
matrix:
runner: ${{ fromJSON(needs.runners.outputs.windows) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- id: without-parameters
uses: ./
- run: test "${env:GREET}" = "Hello World"
env:
GREET: ${{ steps.without-parameters.outputs.greet }}
- run: test "$(cat greet.txt)" = "Hello World"
- id: with-parameters
uses: ./
with:
who-to-greet: composite action
- run: test "${env:GREET}" = "Hello composite action"
env:
GREET: ${{ steps.with-parameters.outputs.greet }}
- run: test "$(cat greet.txt)" = "Hello composite action"
# Make up matrix statuses into a status for status checks in branch protection rules
test-passing:
needs: [ test-bash, test-powershell ]
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- run: echo "All tests have passed."