@@ -28,21 +28,38 @@ concurrency:
28
28
cancel-in-progress : true
29
29
30
30
jobs :
31
+ build_matrix :
32
+ runs-on : ubuntu-latest
33
+ outputs :
34
+ matrix : ${{ steps.matrix.outputs.matrix }}
35
+ steps :
36
+ - id : matrix
37
+ name : build matrix
38
+ shell : python
39
+ run : |
40
+ import os
41
+ import json
42
+ reduced = [
43
+ ("x86_64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
44
+ ("aarch64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
45
+ ("i686", "ubuntu-22.04", ("manylinux2014", "musllinux_1_2")),
46
+ ("armv7l", "ubuntu-22.04", ("manylinux_2_31", "musllinux_1_2")),
47
+ ]
48
+ expanded = [{"policy": policy, "platform": platform, "runner": runner} for platform, runner, policies in reduced for policy in policies]
49
+ print(json.dumps(expanded, indent=2))
50
+ with open(os.environ["GITHUB_OUTPUT"], "at") as f:
51
+ f.write(f"matrix={json.dumps(expanded)}")
52
+
31
53
build_manylinux :
32
54
name : ${{ matrix.policy }}_${{ matrix.platform }}
33
- runs-on : ubuntu-22.04
55
+ needs : build_matrix
56
+ runs-on : ${{ matrix.runner }}
34
57
permissions :
35
58
actions : write # this permission is needed to delete cache
36
59
strategy :
37
60
fail-fast : false
38
61
matrix :
39
- policy : ["manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2"]
40
- platform : ["x86_64"]
41
- include :
42
- - policy : " manylinux2014"
43
- platform : " i686"
44
- - policy : " musllinux_1_2"
45
- platform : " i686"
62
+ include : ${{ fromJson(needs.build_matrix.outputs.matrix) }}
46
63
env :
47
64
POLICY : ${{ matrix.policy }}
48
65
PLATFORM : ${{ matrix.platform }}
0 commit comments