@@ -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,53 +67,63 @@ 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 Node.js
4673 uses : actions-ext/node/setup@0ea5bdcd24d2488b28e16bf611b446a2f8e1e12f
4774 with :
4875 version : 22.x
76+ if : matrix.target == 'native'
4977
5078 - name : Setup C++
5179 uses : actions-ext/cpp/setup@c2b1e90366b3a1c628a1df0748135f5e345ab26f
5280
5381 - name : Setup Emscripten
5482 uses : mymindstorm/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
83+ if : matrix.target == 'native'
5584
5685 - name : Install dependencies
5786 run : make develop
87+ if : matrix.target == 'native'
5888
5989 - name : Lint
6090 run : make lint
61- if : matrix.os == 'ubuntu-latest'
91+ if : matrix.name == 'ubuntu-latest'
6292
6393 - name : Checks
6494 run : make checks
65- if : matrix.os == 'ubuntu-latest'
95+ if : matrix.name == 'ubuntu-latest'
6696
6797 - name : Test
6898 run : make coverage
99+ if : matrix.target == 'native'
100+
101+ - name : Build and test Pyodide wheel
102+ run : make test-pyodide
103+ if : matrix.target == 'pyodide'
69104
70105 - name : Upload test results (Python)
71106 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
72107 with :
73- name : test-results-${{ matrix.os }}
108+ name : test-results-${{ matrix.name }}
74109 path : junit.xml
75- if : matrix.os == 'ubuntu-latest'
110+ if : matrix.name == 'ubuntu-latest'
76111
77112 - name : Publish test results
78113 uses : EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
79114 with :
80115 files : ' **/junit.xml'
81- if : matrix.os == 'ubuntu-latest'
116+ if : matrix.name == 'ubuntu-latest'
82117
83118 - name : Upload coverage
84119 uses : codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
85120 with :
86121 token : ${{ secrets.CODECOV_TOKEN }}
122+ if : matrix.target == 'native'
87123
88124 - name : Install build dependencies
89125 run : pip install cibuildwheel
126+ if : matrix.target == 'native'
90127
91128 - name : Build distributions (Linux x86_64)
92129 run : |
98135 CIBW_BUILD : " cp311-manylinux*"
99136 CIBW_ARCHS_LINUX : native
100137 CIBW_BUILD_VERBOSITY : 3
101- if : matrix.os == 'ubuntu-latest'
138+ if : matrix.name == 'ubuntu-latest'
102139
103140 - name : Build distributions (Linux ARM64)
104141 run : |
@@ -109,7 +146,7 @@ jobs:
109146 CIBW_BUILD : " cp311-manylinux*"
110147 CIBW_ARCHS_LINUX : native
111148 CIBW_BUILD_VERBOSITY : 3
112- if : matrix.os == 'ubuntu-24.04-arm'
149+ if : matrix.name == 'ubuntu-24.04-arm'
113150
114151 - name : Build distributions (macOS)
115152 run : |
@@ -118,30 +155,30 @@ jobs:
118155 env :
119156 CIBW_BUILD : " cp311-macos*"
120157 CIBW_BUILD_VERBOSITY : 3
121- if : matrix.os == 'macos-latest'
158+ if : matrix.name == 'macos-latest'
122159
123160 - name : Build distributions (Windows)
124161 run : |
125162 if (Test-Path dist) { Remove-Item dist -Recurse -Force }
126163 make dist-py-wheel
127164 env :
128165 CIBW_BUILD : " cp311-win_amd64"
129- if : matrix.os == 'windows-latest'
166+ if : matrix.name == 'windows-latest'
130167
131168 - name : Test wheel
132169 uses : actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446
133170 with :
134171 module : python_template_cppjswasm
135- if : runner.os == 'Linux'
172+ if : matrix.target == 'native' && runner.os == 'Linux'
136173
137174 - name : Test source distribution
138175 uses : actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446
139176 with :
140177 module : python_template_cppjswasm
141- if : matrix.os == 'ubuntu-latest'
178+ if : matrix.name == 'ubuntu-latest'
142179
143180 - name : Upload distributions
144181 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
145182 with :
146- name : dist-${{ matrix.os }}
147- path : dist
183+ name : dist-${{ matrix.name }}
184+ path : ${{ matrix.dist_path }}
0 commit comments