Commit f91adf9
authored
Generate CI matrix at runtime (#428)
Generates the CI matrix dynamically so we can run subsets on pull
requests.
- Moves the matrix definition out of GitHub workflows into a
`ci-targets.yaml` file
- Adds a `ci-matrix.py` script which parses the `ci-targets.yaml` file
and outputs a JSON matrix
- Updates the GitHub Actions workflows to use the script to generate a
matrix dynamically
- Uses the labels on the pull request to allow subsetting of the matrix
For example, you can run the matrix generator locally to see the label
subsetting in action:
```console
❯ uv run ci-matrix.py --label arch:x86_64,platform:linux,libc:gnu,build:freethreaded,build:lto | jq
Reading inline script metadata from `ci-matrix.py`
{
"include": [
{
"arch": "x86_64",
"target_triple": "x86_64-unknown-linux-gnu",
"platform": "linux",
"libc": "gnu",
"run": "true",
"python": "3.13",
"build_options": "freethreaded+pgo+lto"
},
{
"arch": "x86_64",
"target_triple": "x86_64_v2-unknown-linux-gnu",
"platform": "linux",
"arch_variant": "v2",
"libc": "gnu",
"run": "true",
"python": "3.13",
"build_options": "freethreaded+pgo+lto"
},
{
"arch": "x86_64",
"target_triple": "x86_64_v3-unknown-linux-gnu",
"platform": "linux",
"arch_variant": "v3",
"libc": "gnu",
"run": "true",
"python": "3.13",
"build_options": "freethreaded+pgo+lto"
},
{
"arch": "x86_64",
"target_triple": "x86_64_v4-unknown-linux-gnu",
"platform": "linux",
"arch_variant": "v4",
"libc": "gnu",
"python": "3.13",
"build_options": "freethreaded+lto"
}
]
}
```
I'll add labels for
- `platform:darwin`
- `platform:linux`
- `platform:windows`
- `python:3.9`
- `python:3.10`
- `python:3.11`
- `python:3.12`
- `python:3.13`
- `build:debug`
- `build:pgo`
- `build:lto`
- `build:noopt`
- `build:freethreaded`
- `arch:x86_64`
- `arch:aarch64`
- `arch:armv7`
- `arch:s390x`
- `arch:ppc64le`
- `arch:x86`
- `libc:gnu`
- `libc:musl`
In a follow-up, I'll update this to use different runners in forks as
noted in #4261 parent 4446f7d commit f91adf9
File tree
5 files changed
+608
-1125
lines changed- .github/workflows
5 files changed
+608
-1125
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 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 | + | |
43 | 67 | | |
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 | 68 | | |
| 69 | + | |
170 | 70 | | |
171 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
172 | 76 | | |
173 | 77 | | |
174 | 78 | | |
| |||
187 | 91 | | |
188 | 92 | | |
189 | 93 | | |
190 | | - | |
| 94 | + | |
191 | 95 | | |
192 | | - | |
| 96 | + | |
193 | 97 | | |
194 | 98 | | |
195 | | - | |
| 99 | + | |
196 | 100 | | |
197 | 101 | | |
198 | 102 | | |
199 | | - | |
| 103 | + | |
200 | 104 | | |
201 | 105 | | |
202 | 106 | | |
203 | 107 | | |
204 | | - | |
| 108 | + | |
205 | 109 | | |
206 | 110 | | |
207 | 111 | | |
| |||
0 commit comments