Repository navigation
Expand file tree
/
Copy pathValidation.Tests.Matrix.Job.yml
More file actions
243 lines (220 loc) · 9.23 KB
/
Copy pathValidation.Tests.Matrix.Job.yml
File metadata and controls
243 lines (220 loc) · 9.23 KB
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: Create Validation Test Matrix
on:
workflow_call:
inputs:
plan:
description: Test plan to resolve.
required: true
type: string
permissions:
actions: read
contents: read
jobs:
resolve:
name: resolve "${{ inputs.plan }}" test matrix
runs-on: ubuntu-latest
outputs:
windows: ${{ steps.matrix.outputs.windows }}
linux: ${{ steps.matrix.outputs.linux }}
macos: ${{ steps.matrix.outputs.macos }}
has_windows: ${{ steps.matrix.outputs.has_windows }}
has_linux: ${{ steps.matrix.outputs.has_linux }}
has_macos: ${{ steps.matrix.outputs.has_macos }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Resolve test combinations
id: matrix
run: node scripts/ci/resolve-validation-test-matrix.mjs --plan "${{ inputs.plan }}"
windows:
name: ${{ matrix.os }}, ${{ matrix.architecture }}, ${{ matrix.backend }}
needs: resolve
if: needs.resolve.outputs.has_windows == 'true'
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.windows) }}
runs-on: [ "${{ matrix.pool }}" ]
timeout-minutes: 180
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download ${{ matrix.target }} artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.artifact }}
path: artifacts/bin
- name: Download Windows SDK test bundle
if: matrix.backend == 'isolation-session' || matrix.backend == 'process'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: windows-sdk-test-bundle-${{ matrix.target }}
path: artifacts/bin/windows-sdk-bundle
- name: Delayed start
if: matrix.startup_delay_seconds > 0
shell: powershell
run: |
# Spreads network-heavy setup across the pool's shared egress address
# instead of issuing every job's downloads at once. Configured by
# backendDelayedStart in scripts/ci/validation-test-matrix.json.
$seconds = ${{ matrix.startup_delay_seconds }}
Write-Host "Waiting $seconds second(s) before downloading prerequisites."
Start-Sleep -Seconds $seconds
- name: Prepare backend prerequisites
timeout-minutes: 20
shell: powershell
run: |
& ./scripts/ci/prepare-windows-host.ps1 `
-Backend '${{ matrix.backend }}' `
-BinaryDirectory (Join-Path $env:GITHUB_WORKSPACE 'artifacts\bin') *>&1 |
Tee-Object -FilePath (Join-Path $env:RUNNER_TEMP 'mxc-ci.log') -Append
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Run backend tests
timeout-minutes: 45
shell: pwsh
run: |
& ./scripts/ci/run_backend_validation_tests.ps1 `
-Backend '${{ matrix.backend }}' `
-BinaryDirectory (Join-Path $env:GITHUB_WORKSPACE 'artifacts\bin') `
-Architecture '${{ matrix.architecture }}' `
-TempDirectory (Join-Path $env:RUNNER_TEMP 'mxc-test-temp') *>&1 |
Tee-Object -FilePath (Join-Path $env:RUNNER_TEMP 'mxc-ci.log') -Append
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Upload logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: logs-${{ inputs.plan }}-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.backend }}-${{ github.run_attempt }}
# The run step points the suites' TEMP at mxc-test-temp, so suite
# logs and scratch trees are collected without enumerating each one;
# runner.temp itself is shared with the runner and the actions.
# Exclude bulk binaries that tooling also drops in TEMP; they dwarf
# the logs and aid no triage.
path: |
${{ runner.temp }}/mxc-test-temp
${{ runner.temp }}/mxc-ci.log
!${{ runner.temp }}/**/*.vhd
!${{ runner.temp }}/**/*.vhdx
!${{ runner.temp }}/**/*.tar
!${{ runner.temp }}/**/*.msi
!${{ runner.temp }}/**/*.msix
!${{ runner.temp }}/**/*.appx
!${{ runner.temp }}/**/*.zip
!${{ runner.temp }}/**/*.exe
!${{ runner.temp }}/**/*.dll
if-no-files-found: ignore
retention-days: 7
linux:
name: ${{ matrix.os }}, ${{ matrix.architecture }}, ${{ matrix.backend }}
needs: resolve
if: needs.resolve.outputs.has_linux == 'true'
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.linux) }}
runs-on: [ "${{ matrix.pool }}" ]
timeout-minutes: 180
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download ${{ matrix.target }} artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.artifact }}
path: artifacts/bin
- name: Delayed start
if: matrix.startup_delay_seconds > 0
shell: bash
run: |
# Spreads network-heavy setup across the pool's shared egress address
# instead of issuing every job's downloads at once. Configured by
# backendDelayedStart in scripts/ci/validation-test-matrix.json.
set -euo pipefail
seconds=${{ matrix.startup_delay_seconds }}
echo "Waiting $seconds second(s) before downloading prerequisites."
sleep "$seconds"
- name: Prepare backend prerequisites
timeout-minutes: 15
shell: bash
run: |
set -euo pipefail
bash scripts/ci/prepare-linux-host.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee -a "$RUNNER_TEMP/mxc-ci.log"
- name: Run backend tests
timeout-minutes: 45
shell: bash
run: |
set -euo pipefail
if [[ '${{ matrix.backend }}' == 'lxc' ]]; then
sudo --preserve-env=RUNNER_TEMP bash scripts/ci/run_backend_validation_tests.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee -a "$RUNNER_TEMP/mxc-ci.log"
else
bash scripts/ci/run_backend_validation_tests.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee -a "$RUNNER_TEMP/mxc-ci.log"
fi
- name: Upload logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: logs-${{ inputs.plan }}-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.backend }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/mxc-ci.log
if-no-files-found: ignore
retention-days: 7
macos:
name: ${{ matrix.os }}, ${{ matrix.backend }}
needs: resolve
if: needs.resolve.outputs.has_macos == 'true'
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.macos) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 180
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download ${{ matrix.target }} artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.artifact }}
path: artifacts/bin
- name: Delayed start
if: matrix.startup_delay_seconds > 0
shell: bash
run: |
# Spreads network-heavy setup across the pool's shared egress address
# instead of issuing every job's downloads at once. Configured by
# backendDelayedStart in scripts/ci/validation-test-matrix.json.
set -euo pipefail
seconds=${{ matrix.startup_delay_seconds }}
echo "Waiting $seconds second(s) before starting tests."
sleep "$seconds"
- name: Prepare backend prerequisites
timeout-minutes: 15
shell: bash
run: |
set -euo pipefail
bash scripts/ci/prepare-macos-host.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee "$RUNNER_TEMP/mxc-ci.log"
- name: Run backend tests
timeout-minutes: 60
shell: bash
run: |
set -euo pipefail
chmod +x artifacts/bin/mxc-exec-mac artifacts/bin/unix-test-proxy
bash scripts/ci/run_backend_validation_tests.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee -a "$RUNNER_TEMP/mxc-ci.log"
- name: Upload logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: logs-${{ inputs.plan }}-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.backend }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/mxc-ci.log
if-no-files-found: ignore
retention-days: 7