@@ -38,22 +38,39 @@ jobs:
38
38
python-version : " 3.x"
39
39
-
uses :
pre-commit/[email protected]
40
40
41
+ build_matrix :
42
+ needs : pre_commit
43
+ runs-on : ubuntu-latest
44
+ outputs :
45
+ matrix : ${{ steps.matrix.outputs.matrix }}
46
+ steps :
47
+ - id : matrix
48
+ name : build matrix
49
+ shell : python
50
+ run : |
51
+ import os
52
+ import json
53
+ reduced = [
54
+ ("x86_64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
55
+ ("aarch64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
56
+ ("i686", "ubuntu-22.04", ("manylinux2014", "musllinux_1_2")),
57
+ ("armv7l", "ubuntu-22.04", ("manylinux_2_31", "musllinux_1_2")),
58
+ ]
59
+ expanded = [{"policy": policy, "platform": platform, "runner": runner} for platform, runner, policies in reduced for policy in policies]
60
+ print(json.dumps(expanded, indent=2))
61
+ with open(os.environ["GITHUB_OUTPUT"], "at") as f:
62
+ f.write(f"matrix={json.dumps(expanded)}")
63
+
41
64
build_manylinux :
42
- needs : [pre_commit]
43
65
name : ${{ matrix.policy }}_${{ matrix.platform }}
44
- runs-on : ubuntu-22.04
66
+ needs : build_matrix
67
+ runs-on : ${{ matrix.runner }}
45
68
permissions :
46
69
actions : write # this permission is needed to delete cache
47
70
strategy :
48
71
fail-fast : false
49
72
matrix :
50
- policy : ["manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2"]
51
- platform : ["x86_64"]
52
- include :
53
- - policy : " manylinux2014"
54
- platform : " i686"
55
- - policy : " musllinux_1_2"
56
- platform : " i686"
73
+ include : ${{ fromJson(needs.build_matrix.outputs.matrix) }}
57
74
env :
58
75
POLICY : ${{ matrix.policy }}
59
76
PLATFORM : ${{ matrix.platform }}
68
85
- name : Set up emulation
69
86
if : matrix.platform != 'i686' && matrix.platform != 'x86_64'
70
87
uses : docker/setup-qemu-action@v3
71
- with :
72
- platforms : ${{ matrix.platform }}
73
88
74
89
- name : Set up Docker Buildx
75
90
uses : docker/setup-buildx-action@v3
0 commit comments