@@ -25,11 +25,33 @@ permissions:
2525
2626jobs :
2727 build :
28+ name : build (${{ matrix.name }})
2829 runs-on : ${{ matrix.os }}
2930
3031 strategy :
3132 matrix :
32- os : [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
33+ include :
34+ - name : ubuntu-latest
35+ dist_path : dist
36+ os : ubuntu-latest
37+ python : " 3.11"
38+ target : native
39+ - name : ubuntu-24.04-arm
40+ dist_path : dist
41+ os : ubuntu-24.04-arm
42+ python : " 3.11"
43+ target : native
44+ - name : macos-latest
45+ dist_path : dist
46+ os : macos-latest
47+ python : " 3.11"
48+ target : native
49+ - name : windows-latest
50+ dist_path : dist
51+ os : windows-latest
52+ python : " 3.11"
53+ target : native
54+
3355
3456 steps :
3557 - name : Checkout
4062 - name : Setup Python
4163 uses : actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446
4264 with :
43- version : " 3.11 "
65+ version : ${{ matrix.python }}
4466
4567 - name : Setup Rust
4668 uses : actions-ext/rust/setup@2db8e3e4c56beb7320c7d730bd2c2d6a6447bf6b
@@ -49,48 +71,57 @@ jobs:
4971 uses : actions-ext/node/setup@0ea5bdcd24d2488b28e16bf611b446a2f8e1e12f
5072 with :
5173 version : 22.x
74+ if : matrix.target == 'native'
5275
5376 - name : Install dependencies
5477 run : make develop
78+ if : matrix.target == 'native'
5579
5680 - name : Lint
5781 run : make lint
58- if : matrix.os == 'ubuntu-latest'
82+ if : matrix.name == 'ubuntu-latest'
5983
6084 - name : Checks
6185 run : make checks
62- if : matrix.os == 'ubuntu-latest'
86+ if : matrix.name == 'ubuntu-latest'
6387
6488 - name : Build
6589 run : make build
90+ if : matrix.target == 'native'
6691
6792 - name : Test
6893 run : make coverage
94+ if : matrix.target == 'native'
95+
96+ - name : Build and test Pyodide wheel
97+ run : make test-pyodide
98+ if : matrix.target == 'pyodide'
6999
70100 - name : Upload test results (Python)
71101 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
72102 with :
73- name : test-results-${{ matrix.os }}
103+ name : test-results-${{ matrix.name }}
74104 path : ' **/junit.xml'
75- if : matrix.os == 'ubuntu-latest'
105+ if : matrix.name == 'ubuntu-latest'
76106
77107 - name : Publish test results
78108 uses : EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
79109 with :
80110 files : ' **/junit.xml'
81- if : matrix.os == 'ubuntu-latest'
111+ if : matrix.name == 'ubuntu-latest'
82112
83113 - name : Upload coverage
84114 uses : codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
85115 with :
86116 token : ${{ secrets.CODECOV_TOKEN }}
117+ if : matrix.target == 'native'
87118
88119 - name : Free disk space
89120 run : |
90121 sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/share/swift
91122 df -h /
92123 shell : bash
93- if : runner.os == 'Linux'
124+ if : matrix.target == 'native' && runner.os == 'Linux'
94125
95126 - name : Build distributions (Linux x86_64)
96127 run : |
@@ -102,7 +133,7 @@ jobs:
102133 shell : bash
103134 env :
104135 CIBW_ARCHS_LINUX : native
105- if : matrix.os == 'ubuntu-latest'
136+ if : matrix.name == 'ubuntu-latest'
106137
107138 - name : Build distributions (Linux ARM64)
108139 run : |
@@ -112,7 +143,7 @@ jobs:
112143 shell : bash
113144 env :
114145 CIBW_ARCHS_LINUX : native
115- if : matrix.os == 'ubuntu-24.04-arm'
146+ if : matrix.name == 'ubuntu-24.04-arm'
116147
117148 - name : Build distributions (macOS/Windows)
118149 run : |
@@ -122,22 +153,22 @@ jobs:
122153 shell : bash
123154 env :
124155 CIBW_ENVIRONMENT_MACOS : MACOSX_DEPLOYMENT_TARGET=11.0
125- if : runner.os != 'Linux'
156+ if : matrix.target == 'native' && runner.os != 'Linux'
126157
127158 - name : Test wheel
128159 uses : actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446
129160 with :
130161 module : python_template_rust
131- if : runner.os == 'Linux'
162+ if : matrix.target == 'native' && runner.os == 'Linux'
132163
133164 - name : Test source distribution
134165 uses : actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446
135166 with :
136167 module : python_template_rust
137- if : matrix.os == 'ubuntu-latest'
168+ if : matrix.name == 'ubuntu-latest'
138169
139170 - name : Upload distributions
140171 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
141172 with :
142- name : dist-${{ matrix.os }}
143- path : dist
173+ name : dist-${{ matrix.name }}
174+ path : ${{ matrix.dist_path }}
0 commit comments