@@ -25,11 +25,38 @@ 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+ - name : pyodide
55+ dist_path : dist/pyodide
56+ os : ubuntu-latest
57+ python : " 3.14"
58+ target : pyodide
59+
3360
3461 steps :
3562 - name : Checkout
@@ -40,51 +67,60 @@ jobs:
4067 - name : Setup Python
4168 uses : actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446
4269 with :
43- version : " 3.11 "
70+ version : ${{ matrix.python }}
4471
4572 - name : Setup Rust
4673 uses : actions-ext/rust/setup@2db8e3e4c56beb7320c7d730bd2c2d6a6447bf6b
4774
4875 - name : Install dependencies
4976 run : make develop
77+ if : matrix.target == 'native'
5078
5179 - name : Lint
5280 run : make lint
81+ if : matrix.target == 'native'
5382
5483 - name : Checks
5584 run : make checks
56- if : matrix.os == 'ubuntu-latest'
85+ if : matrix.name == 'ubuntu-latest'
5786
5887 - name : Build
5988 run : make build
89+ if : matrix.target == 'native'
6090
6191 - name : Test
6292 run : make coverage
93+ if : matrix.target == 'native'
94+
95+ - name : Build and test Pyodide wheel
96+ run : make test-pyodide
97+ if : matrix.target == 'pyodide'
6398
6499 - name : Upload test results (Python)
65100 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
66101 with :
67- name : test-results-${{ matrix.os }}
102+ name : test-results-${{ matrix.name }}
68103 path : ' **/junit.xml'
69- if : always()
104+ if : always() && matrix.target == 'native'
70105
71106 - name : Publish test results
72107 uses : EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
73108 with :
74109 files : ' **/junit.xml'
75- if : matrix.os == 'ubuntu-latest'
110+ if : matrix.name == 'ubuntu-latest'
76111
77112 - name : Upload coverage
78113 uses : codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
79114 with :
80115 token : ${{ secrets.CODECOV_TOKEN }}
116+ if : matrix.target == 'native'
81117
82118 - name : Free disk space
83119 run : |
84120 sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/share/swift
85121 df -h /
86122 shell : bash
87- if : runner.os == 'Linux'
123+ if : matrix.target == 'native' && runner.os == 'Linux'
88124
89125 - name : Build distributions (Linux x86_64)
90126 run : |
96132 shell : bash
97133 env :
98134 CIBW_ARCHS_LINUX : native
99- if : matrix.os == 'ubuntu-latest'
135+ if : matrix.name == 'ubuntu-latest'
100136
101137 - name : Build distributions (Linux ARM64)
102138 run : |
@@ -106,7 +142,7 @@ jobs:
106142 shell : bash
107143 env :
108144 CIBW_ARCHS_LINUX : native
109- if : matrix.os == 'ubuntu-24.04-arm'
145+ if : matrix.name == 'ubuntu-24.04-arm'
110146
111147 - name : Build distributions (macOS/Windows)
112148 run : |
@@ -116,22 +152,22 @@ jobs:
116152 shell : bash
117153 env :
118154 CIBW_ENVIRONMENT_MACOS : MACOSX_DEPLOYMENT_TARGET=11.0
119- if : runner.os != 'Linux'
155+ if : matrix.target == 'native' && runner.os != 'Linux'
120156
121157 - name : Test wheel
122158 uses : actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446
123159 with :
124160 module : python_template_rust
125- if : runner.os == 'Linux'
161+ if : matrix.target == 'native' && runner.os == 'Linux'
126162
127163 - name : Test source distribution
128164 uses : actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446
129165 with :
130166 module : python_template_rust
131- if : matrix.os == 'ubuntu-latest'
167+ if : matrix.name == 'ubuntu-latest'
132168
133169 - name : Upload distributions
134170 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
135171 with :
136- name : dist-${{ matrix.os }}
137- path : dist
172+ name : dist-${{ matrix.name }}
173+ path : ${{ matrix.dist_path }}
0 commit comments