-
Notifications
You must be signed in to change notification settings - Fork 27
193 lines (174 loc) · 6.17 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Test
concurrency:
group: test-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;
build-all-rapids-repos:
if: needs.check-event.outputs.ok == 'true' && github.repository_owner == 'rapidsai'
name: Build
needs: check-event
secrets: inherit
uses: ./.github/workflows/build-all-rapids-repos.yml
validate-features-json:
if: needs.check-event.outputs.ok == 'true'
name: Validate Features
needs: check-event
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install devcontainers CLI
uses: ./.github/actions/install-devcontainers-cli
- name: Validate devcontainer-feature.json files
uses: devcontainers/action@v1
with:
validate-only: true
base-path-to-features: "./features/src"
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@v4
with:
fetch-depth: 0
persist-credentials: false
- id: get-pr-info
name: Get PR target branch info
uses: ./.github/actions/get-pr-info
- name: Copy common scripts into features
uses: ./.github/actions/copy-common-scripts
- id: matrix
name: Determine features matrix
uses: ./.github/actions/feature-matrix
with:
full_matrix: false
base_sha: "${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}"
file_patterns: |
features/test/**
.github/workflows/test.yml
.github/actions/feature-matrix/*
.github/actions/build-and-test-feature/*
.github/workflows/build-and-test-feature.yml
run-feature-integration-tests:
if: needs.features-matrix.outputs.features != '[]' || needs.features-matrix.outputs.scenarios != '[]'
name: Feature integration
needs: features-matrix
secrets: inherit
uses: ./.github/workflows/build-and-test-feature.yml
with:
name: "{0}"
args: "--global-scenarios-only"
run-feature-scenario-tests:
if: needs.features-matrix.outputs.scenarios != '[]'
name: Test ${{ matrix.feature }} 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: "{0}"
args: "-f ${{ matrix.feature }} --skip-autogenerated"
run-generated-feature-tests:
if: needs.features-matrix.outputs.features != '[]'
name: Test ${{ matrix.feature }} 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: "{0}"
args: "-f ${{ matrix.feature }} -i ubuntu:22.04 --skip-scenarios"
image-matrix:
name: Determine image matrix
needs: features-matrix
runs-on: ubuntu-latest
outputs:
linux: ${{ steps.matrix.outputs.linux }}
windows: ${{ steps.matrix.outputs.windows }}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- id: get-pr-info
name: Get PR target branch info
uses: ./.github/actions/get-pr-info
- 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 }}"
base_sha: "${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}"
file_patterns: |
.github/actions/build-linux-image/*
.github/actions/build-windows-image/*
.github/actions/image-matrix/*
.github/actions/test-windows-image/*
.github/workflows/test.yml
.github/workflows/build-test-and-push-linux-image.yml
.github/workflows/build-test-and-push-windows-image.yml
build-and-test-linux-images:
if: needs.image-matrix.outputs.linux != '{"include":[]}'
name: ${{ matrix.name || 'Linux' }}
needs: image-matrix
secrets: inherit
uses: ./.github/workflows/build-test-and-push-linux-image.yml
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.image-matrix.outputs.linux) }}
with:
push: false
os: "${{ matrix.os }}"
features: "${{ toJSON(matrix.features) }}"
container_env: "${{ toJSON(matrix.env) }}"
repo: "${{ vars.DOCKERHUB_REPOSITORY || github.repository }}"
build-and-test-windows-images:
if: needs.image-matrix.outputs.windows != '{"include":[]}'
name: ${{ matrix.name || 'Windows' }}
needs: image-matrix
secrets: inherit
uses: ./.github/workflows/build-test-and-push-windows-image.yml
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.image-matrix.outputs.windows) }}
with:
push: false
os: "${{ matrix.os }}"
features: "${{ toJSON(matrix.features) }}"
container_env: "${{ toJSON(matrix.env) }}"
repo: "${{ vars.DOCKERHUB_REPOSITORY || github.repository }}"