Repository navigation
215 lines (190 loc) · 8.66 KB
/
Copy pathstdlib.yml
File metadata and controls
215 lines (190 loc) · 8.66 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
name: stdlib
on:
workflow_dispatch:
inputs:
sha:
description: "The full SHA of a commit with completed build workflows."
required: true
type: string
filters:
description: "Optional CI filters, restricted to available artifacts (e.g., 'platform:linux,python:3.14,build:pgo')."
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ inputs.sha }}-${{ inputs.filters }}
cancel-in-progress: false
permissions:
actions: read
contents: read
jobs:
generate-matrix:
name: Generate test matrix
runs-on: ubuntu-latest
outputs:
linux-matrix-0: ${{ steps.set-matrix.outputs.linux-matrix-0 }}
linux-matrix-1: ${{ steps.set-matrix.outputs.linux-matrix-1 }}
macos-matrix: ${{ steps.set-matrix.outputs.macos-matrix }}
windows-matrix: ${{ steps.set-matrix.outputs.windows-matrix }}
any-linux-0: ${{ steps.set-matrix.outputs.any-linux-0 }}
any-linux-1: ${{ steps.set-matrix.outputs.any-linux-1 }}
any-macos: ${{ steps.set-matrix.outputs.any-macos }}
any-windows: ${{ steps.set-matrix.outputs.any-windows }}
linux-run-id: ${{ steps.set-matrix.outputs.linux-run-id }}
macos-run-id: ${{ steps.set-matrix.outputs.macos-run-id }}
windows-run-id: ${{ steps.set-matrix.outputs.windows-run-id }}
steps:
# The helper may not exist at the commit whose artifacts we are testing.
- name: Check out workflow helper
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.workflow_sha }}
path: workflow-tools
sparse-checkout: scripts/stdlib_test_matrix.py
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Check out target configuration
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.sha }}
path: target
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: false
- name: Generate test matrix
id: set-matrix
working-directory: target
env:
GH_TOKEN: ${{ github.token }}
INPUT_SHA: ${{ inputs.sha }}
INPUT_FILTERS: ${{ inputs.filters }}
run: |
uv run ci-matrix.py --platform linux --event push --labels "${INPUT_FILTERS}" > linux.json
uv run ci-matrix.py --platform darwin --event push --labels "${INPUT_FILTERS}" > macos.json
uv run ci-matrix.py --platform windows --event push --labels "${INPUT_FILTERS}" > windows.json
uv run --script ../workflow-tools/scripts/stdlib_test_matrix.py \
--repository "${GITHUB_REPOSITORY}" \
--sha "${INPUT_SHA}" \
--matrix-dir . \
--github-output "${GITHUB_OUTPUT}"
linux-0:
name: linux / ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
if: ${{ needs.generate-matrix.outputs.any-linux-0 == 'true' }}
needs: generate-matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.linux-matrix-0) }}
steps: &linux_steps
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.sha }}
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: false
- name: Download distribution
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
github-token: ${{ github.token }}
run-id: ${{ needs.generate-matrix.outputs.linux-run-id }}
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
path: dist
- name: Run stdlib tests
env:
JUNIT_FILENAME: junit-cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}.xml
MATRIX_LIBC: ${{ matrix.libc }}
run: |
if [ "${MATRIX_LIBC}" = "musl" ]; then
sudo apt install --yes musl-dev
unset LD_LIBRARY_PATH
fi
uv run --no-dev test-distribution.py --junit-xml "${JUNIT_FILENAME}" --stdlib dist/*.tar.zst
- name: Upload JUnit test results
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}-junit
path: junit-cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}.xml
linux-1:
name: linux / ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
if: ${{ needs.generate-matrix.outputs.any-linux-1 == 'true' }}
needs: generate-matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.linux-matrix-1) }}
steps: *linux_steps
macos:
name: macos / ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
if: ${{ needs.generate-matrix.outputs.any-macos == 'true' }}
needs: generate-matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.macos-matrix) }}
steps:
- uses: astral-sh/github-actions/demudhra@7aa50a3def9f5428c532b0ae972d1e5b357de5a5 # 2026.11.03.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.sha }}
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: false
- name: Download distribution
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
github-token: ${{ github.token }}
run-id: ${{ needs.generate-matrix.outputs.macos-run-id }}
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
path: dist
- name: Run stdlib tests
env:
JUNIT_FILENAME: junit-cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}.xml
run: uv run --no-dev test-distribution.py --junit-xml "${JUNIT_FILENAME}" --stdlib dist/*.tar.zst
- name: Upload JUnit test results
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}-junit
path: junit-cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}.xml
windows:
name: windows / ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
if: ${{ needs.generate-matrix.outputs.any-windows == 'true' }}
needs: generate-matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.windows-matrix) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.sha }}
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: false
- name: Download distribution
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
github-token: ${{ github.token }}
run-id: ${{ needs.generate-matrix.outputs.windows-run-id }}
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
path: dist
- name: Run stdlib tests
env:
JUNIT_FILENAME: junit-cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}.xml
run: |
$Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative
uv run --no-dev test-distribution.py --junit-xml $env:JUNIT_FILENAME --stdlib $Dists
- name: Upload JUnit test results
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}-junit
path: junit-cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}.xml