-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathValidation.Tests.Matrix.Job.yml
More file actions
173 lines (155 loc) · 6.52 KB
/
Copy pathValidation.Tests.Matrix.Job.yml
File metadata and controls
173 lines (155 loc) · 6.52 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
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
- 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: [ self-hosted, "1ES.Pool=${{ matrix.pool }}", "JobId=mxc-e2e-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Download ${{ matrix.target }} artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: ${{ matrix.artifact }}
path: artifacts/bin
- name: Prepare backend prerequisites
timeout-minutes: 15
shell: pwsh
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
# A backend that hangs (rather than failing) would otherwise burn the
# full job timeout. Fail fast enough to keep the log useful.
timeout-minutes: 45
shell: pwsh
run: |
& ./tests/scripts/run_ci_backend_tests.ps1 `
-Backend '${{ matrix.backend }}' `
-BinaryDirectory (Join-Path $env:GITHUB_WORKSPACE 'artifacts\bin') `
-Architecture '${{ matrix.architecture }}' *>&1 |
Tee-Object -FilePath (Join-Path $env:RUNNER_TEMP 'mxc-ci.log') -Append
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Upload failure logs
if: failure() || cancelled()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: logs-${{ inputs.plan }}-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.backend }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/mxc-ci.log
${{ runner.temp }}/mxc-wpc-tests/logs
${{ runner.temp }}/WinProcessContainer-Tests.results.*
${{ runner.temp }}/mxc_concurrent_oneshot
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: [ self-hosted, "1ES.Pool=${{ matrix.pool }}", "JobId=mxc-e2e-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Download ${{ matrix.target }} artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: ${{ matrix.artifact }}
path: artifacts/bin
- 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 tests/scripts/run_ci_backend_tests.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee -a "$RUNNER_TEMP/mxc-ci.log"
else
bash tests/scripts/run_ci_backend_tests.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee -a "$RUNNER_TEMP/mxc-ci.log"
fi
- name: Upload failure logs
if: failure() || cancelled()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
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: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Download ${{ matrix.target }} artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: ${{ matrix.artifact }}
path: artifacts/bin
- 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 tests/scripts/run_ci_backend_tests.sh \
'${{ matrix.backend }}' "$GITHUB_WORKSPACE/artifacts/bin" 2>&1 |
tee "$RUNNER_TEMP/mxc-ci.log"
- name: Upload failure logs
if: failure() || cancelled()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
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