-
Notifications
You must be signed in to change notification settings - Fork 28
128 lines (115 loc) · 3.82 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Test
concurrency:
group: test-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "pull-request/[0-9]+"
jobs:
check-event:
name: Check PR Event
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check_pr_event.outputs.ok }}
steps:
- id: check_pr_event
name: Check PR Event
shell: bash
run: |
[[ '${{ github.event_name }}' == 'push' && '${{ github.repository }}' == 'rapidsai/devcontainers' ]] || \
[[ '${{ github.event_name }}' == 'pull_request' && '${{ github.repository }}' != 'rapidsai/devcontainers' ]] \
&& echo "ok=true" | tee -a $GITHUB_OUTPUT \
|| echo "ok=false" | tee -a $GITHUB_OUTPUT;
validate-features-json:
if: needs.check-event.outputs.ok == 'true'
name: Validate features
needs: check-event
secrets: inherit
uses: ./.github/workflows/validate-features-json.yml
features-matrix:
name: Determine features matrix
needs: validate-features-json
runs-on: ubuntu-latest
outputs:
features: ${{ steps.matrix.outputs.features }}
scenarios: ${{ steps.matrix.outputs.scenarios }}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Copy common scripts into features
uses: ./.github/actions/copy-common-scripts
- id: matrix
name: Determine features matrix
uses: ./.github/actions/feature-matrix
run-feature-integration-tests:
if: needs.features-matrix.outputs.features != '[]' || needs.features-matrix.outputs.scenarios != '[]'
name: Integration
needs: features-matrix
secrets: inherit
uses: ./.github/workflows/build-and-test-feature.yml
with:
name: "Test global scenarios"
args: "--global-scenarios-only"
run-feature-scenario-tests:
if: needs.features-matrix.outputs.scenarios != '[]'
name: Test scenarios
needs: features-matrix
secrets: inherit
uses: ./.github/workflows/build-and-test-feature.yml
strategy:
fail-fast: false
matrix:
feature: ${{ fromJSON(needs.features-matrix.outputs.scenarios) }}
with:
name: "Run scenario tests"
args: "-f ${{ matrix.feature }} --skip-autogenerated"
run-generated-feature-tests:
if: needs.features-matrix.outputs.features != '[]'
name: Test feature
needs: features-matrix
secrets: inherit
uses: ./.github/workflows/build-and-test-feature.yml
strategy:
fail-fast: false
matrix:
feature: ${{ fromJSON(needs.features-matrix.outputs.features) }}
with:
name: "Run generated tests"
args: "--skip-scenarios -f ${{ matrix.feature }} -i ubuntu:22.04"
image-matrix:
name: Determine image matrix
needs: features-matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- id: matrix
name: Determine image matrix
uses: ./.github/actions/image-matrix
with:
full_matrix: 'false'
features: "${{ needs.features-matrix.outputs.features }}"
scenarios: "${{ needs.features-matrix.outputs.scenarios }}"
test-images:
if: needs.image-matrix.outputs.matrix != '{"include":[]}'
name: ${{ matrix.name }}
needs: image-matrix
secrets: inherit
uses: ./.github/workflows/build-and-test-image.yml
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.image-matrix.outputs.matrix) }}
with:
os : "${{ matrix.os }}"
features: "${{ toJSON(matrix.features) }}"
container_env: "${{ toJSON(matrix.env) }}"