Skip to content

Commit 257ae87

Browse files
authored
Expand CI coverage (#112)
* run tests on mac and linux * Update action versions * Run on windows
1 parent 72348e0 commit 257ae87

File tree

2 files changed

+77
-83
lines changed

2 files changed

+77
-83
lines changed

.github/workflows/release.yaml

Lines changed: 45 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,29 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
with:
30-
submodules: 'recursive'
30+
submodules: "recursive"
3131

3232
- uses: actions/setup-python@v4
3333
with:
34-
python-version: '3.12'
34+
python-version: "3.12"
3535

36-
- name: Install latest Rust stable toolchain
37-
uses: actions-rs/toolchain@v1
36+
- name: Install latest Rust nightly toolchain
37+
uses: dtolnay/rust-toolchain@nightly
3838
with:
39-
toolchain: stable
40-
default: true
41-
components: clippy, rustfmt
39+
targets: wasm32-wasi wasm32-unknown-unknown
4240

43-
- name: Install latest Rust nightly toolchain
44-
uses: actions-rs/toolchain@v1
41+
- name: Install latest Rust stable toolchain
42+
uses: dtolnay/rust-toolchain@stable
4543
with:
46-
toolchain: nightly
47-
default: false
44+
targets: wasm32-wasi wasm32-unknown-unknown
45+
components: clippy, rustfmt
4846

4947
- name: Install Rust std source
5048
shell: bash
5149
run: rustup component add rust-src --toolchain nightly
5250

53-
- name: Install Wasm Rust targets
54-
shell: bash
55-
run: rustup target add wasm32-wasi wasm32-unknown-unknown
56-
5751
- uses: Swatinem/rust-cache@v2
5852
with:
5953
shared-key: "rust-cache-${{ hashFiles('./Cargo.lock') }}"
@@ -69,7 +63,7 @@ jobs:
6963
7064
- name: Cache CPython
7165
id: cache-cpython-wasi
72-
uses: actions/cache@v3
66+
uses: actions/cache@v4
7367
with:
7468
path: cpython/builddir/wasi
7569
key: cpython-wasi
@@ -106,7 +100,7 @@ jobs:
106100
buildArgs: "--target aarch64-unknown-linux-gnu",
107101
target: "aarch64-unknown-linux-gnu",
108102
targetDir: "target/aarch64-unknown-linux-gnu/release",
109-
}
103+
}
110104
- {
111105
os: "macos-latest",
112106
arch: "amd64",
@@ -139,36 +133,28 @@ jobs:
139133
}
140134
steps:
141135
- name: Checkout
142-
uses: actions/checkout@v3
136+
uses: actions/checkout@v4
143137
with:
144-
submodules: 'recursive'
138+
submodules: "recursive"
145139

146140
- uses: actions/setup-python@v4
147141
with:
148-
python-version: '3.12'
142+
python-version: "3.12"
149143

150-
- name: Install latest Rust stable toolchain
151-
uses: actions-rs/toolchain@v1
144+
- name: Install latest Rust nightly toolchain
145+
uses: dtolnay/rust-toolchain@nightly
152146
with:
153-
toolchain: stable
154-
default: true
155-
target: ${{ matrix.config.target }}
147+
targets: ${{ matrix.config.target }}
156148

157-
- name: Install latest Rust nightly toolchain
158-
uses: actions-rs/toolchain@v1
149+
- name: Install latest Rust stable toolchain
150+
uses: dtolnay/rust-toolchain@stable
159151
with:
160-
toolchain: nightly
161-
default: false
162-
target: ${{ matrix.config.target }}
152+
targets: ${{ matrix.config.target }}
163153

164154
- name: Install Rust std source
165155
shell: bash
166156
run: rustup component add rust-src --toolchain nightly
167157

168-
- name: Install Wasm Rust targets
169-
shell: bash
170-
run: rustup target add wasm32-wasi wasm32-unknown-unknown
171-
172158
- uses: Swatinem/rust-cache@v2
173159
if: matrix.config.os == 'ubuntu-latest' && matrix.config.arch == 'amd64'
174160
with:
@@ -192,26 +178,26 @@ jobs:
192178
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
193179
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
194180
195-
- name: Install WASI-SDK
196-
if: runner.os != 'Windows'
181+
- name: Download WASI-SDK
197182
shell: bash
198183
run: |
199184
cd /tmp
200185
curl -LO https://github.com/dicej/wasi-sdk/releases/download/${WASI_SDK_RELEASE}/wasi-sdk-${WASI_SDK_VERSION}-${{ matrix.config.wasiSDK }}.tar.gz
201186
tar xf wasi-sdk-${WASI_SDK_VERSION}-${{ matrix.config.wasiSDK }}.tar.gz
202-
sudo mv wasi-sdk-${WASI_SDK_VERSION} /opt/wasi-sdk
187+
188+
- name: Install WASI-SDK
189+
if: runner.os != 'Windows'
190+
shell: bash
191+
run: sudo mv /tmp/wasi-sdk-${WASI_SDK_VERSION} /opt/wasi-sdk
203192

204193
- name: Install WASI-SDK on Windows
205194
if: runner.os == 'Windows'
206195
shell: bash
207-
run: |
208-
curl -LO https://github.com/dicej/wasi-sdk/releases/download/${WASI_SDK_RELEASE}/wasi-sdk-${WASI_SDK_VERSION}-mingw.tar.gz
209-
tar xf wasi-sdk-${WASI_SDK_VERSION}-mingw.tar.gz
210-
echo "WASI_SDK_PATH=$(cygpath -m $(pwd)/wasi-sdk-${WASI_SDK_VERSION})" >> ${GITHUB_ENV}
196+
run: echo "WASI_SDK_PATH=$(cygpath -m /tmp/wasi-sdk-${WASI_SDK_VERSION})" >> ${GITHUB_ENV}
211197

212198
- name: Restore CPython
213199
id: cache-cpython-wasi
214-
uses: actions/cache/restore@v3
200+
uses: actions/cache/restore@v4
215201
with:
216202
path: cpython/builddir/wasi
217203
key: cpython-wasi
@@ -252,16 +238,16 @@ jobs:
252238
componentize-py${{ matrix.config.extension }}
253239
254240
- name: Upload wheels
255-
uses: actions/upload-artifact@v3
241+
uses: actions/upload-artifact@v4
256242
with:
257243
name: componentize-py
258244
path: dist
259245

260246
- name: Upload build artifact
261-
uses: actions/upload-artifact@v3
247+
uses: actions/upload-artifact@v4
262248
with:
263-
name: componentize-py
264-
path: _dist/componentize-py-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
249+
name: componentize-py
250+
path: _dist/componentize-py-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
265251

266252
- name: Upload binary to Github release (tag)
267253
if: startsWith(github.ref, 'refs/tags/v')
@@ -287,15 +273,15 @@ jobs:
287273
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV
288274

289275
- name: Download release assets
290-
uses: actions/download-artifact@v3
276+
uses: actions/download-artifact@v4
291277
with:
292-
name: componentize-py
278+
name: componentize-py
293279

294280
- name: Generate checksums
295281
run: |
296282
sha256sum componentize-py-${{ env.RELEASE_VERSION }}*.tar.gz > checksums-${{ env.RELEASE_VERSION }}.txt
297283
298-
- uses: actions/upload-artifact@v3
284+
- uses: actions/upload-artifact@v4
299285
with:
300286
name: componentize-py
301287
path: checksums-${{ env.RELEASE_VERSION }}.txt
@@ -313,17 +299,17 @@ jobs:
313299
runs-on: ubuntu-latest
314300
steps:
315301
- name: Checkout
316-
uses: actions/checkout@v3
302+
uses: actions/checkout@v4
317303
with:
318-
submodules: 'recursive'
319-
304+
submodules: "recursive"
305+
320306
- name: Build sdist
321307
uses: PyO3/maturin-action@v1
322308
with:
323309
command: sdist
324310
args: --out dist
325311
- name: Upload sdist
326-
uses: actions/upload-artifact@v3
312+
uses: actions/upload-artifact@v4
327313
with:
328314
name: componentize-py
329315
path: dist
@@ -335,19 +321,17 @@ jobs:
335321
runs-on: ubuntu-latest
336322
steps:
337323
- name: Download release assets
338-
uses: actions/download-artifact@v3
324+
uses: actions/download-artifact@v4
339325
with:
340-
name: componentize-py
326+
name: componentize-py
341327

342328
- name: Delete canary tag
343-
uses: dev-drprasad/delete-tag-and-release@v0.2.1
329+
run: gh release delete --cleanup-tag -y
344330
env:
345-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
346-
with:
347-
tag_name: canary
331+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
348332

349333
- name: Recreate canary tag and release
350-
uses: ncipollo/release-action@v1.10.0
334+
uses: ncipollo/release-action@v1
351335
with:
352336
tag: canary
353337
allowUpdates: true

.github/workflows/test.yaml

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,60 @@ env:
1616
jobs:
1717
test:
1818
name: Test
19-
runs-on: "ubuntu-latest"
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
config:
23+
- { os: "ubuntu-latest", wasiSDK: "linux" }
24+
- { os: "macos-latest", wasiSDK: "macos" }
25+
- { os: "windows-latest", wasiSDK: "mingw" }
26+
runs-on: ${{ matrix.config.os }}
2027
steps:
2128
- name: Checkout
22-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
2330
with:
24-
submodules: 'recursive'
31+
submodules: "recursive"
2532

26-
- name: Install latest Rust stable toolchain
27-
uses: actions-rs/toolchain@v1
33+
- name: Install latest Rust nightly toolchain
34+
uses: dtolnay/rust-toolchain@nightly
2835
with:
29-
toolchain: stable
30-
default: true
31-
components: clippy, rustfmt
36+
targets: wasm32-wasi wasm32-unknown-unknown
3237

33-
- name: Install latest Rust nightly toolchain
34-
uses: actions-rs/toolchain@v1
38+
- name: Install latest Rust stable toolchain
39+
uses: dtolnay/rust-toolchain@stable
3540
with:
36-
toolchain: nightly
37-
default: false
41+
targets: wasm32-wasi wasm32-unknown-unknown
42+
components: clippy, rustfmt
3843

3944
- name: Install Rust std source
4045
shell: bash
4146
run: rustup component add rust-src --toolchain nightly
4247

43-
- name: Install Wasm Rust targets
44-
shell: bash
45-
run: rustup target add wasm32-wasi wasm32-unknown-unknown
46-
4748
- uses: Swatinem/rust-cache@v2
4849
with:
4950
shared-key: "rust-cache-${{ hashFiles('./Cargo.lock') }}"
50-
cache-on-failure: "false"
51+
cache-on-failure: false
5152

52-
- name: Install WASI-SDK
53+
- name: Download WASI-SDK
5354
shell: bash
5455
run: |
5556
cd /tmp
56-
curl -LO https://github.com/dicej/wasi-sdk/releases/download/${WASI_SDK_RELEASE}/wasi-sdk-${WASI_SDK_VERSION}-linux.tar.gz
57-
tar xf wasi-sdk-${WASI_SDK_VERSION}-linux.tar.gz
58-
mv wasi-sdk-${WASI_SDK_VERSION} /opt/wasi-sdk
57+
curl -LO https://github.com/dicej/wasi-sdk/releases/download/${WASI_SDK_RELEASE}/wasi-sdk-${WASI_SDK_VERSION}-${{ matrix.config.wasiSDK }}.tar.gz
58+
tar xf wasi-sdk-${WASI_SDK_VERSION}-${{ matrix.config.wasiSDK }}.tar.gz
59+
60+
- name: Install WASI-SDK
61+
if: runner.os != 'Windows'
62+
shell: bash
63+
run: sudo mv /tmp/wasi-sdk-${WASI_SDK_VERSION} /opt/wasi-sdk
64+
65+
- name: Install WASI-SDK on Windows
66+
if: runner.os == 'Windows'
67+
shell: bash
68+
run: echo "WASI_SDK_PATH=$(cygpath -m /tmp/wasi-sdk-${WASI_SDK_VERSION})" >> ${GITHUB_ENV}
5969

6070
- name: Cache CPython
6171
id: cache-cpython-wasi
62-
uses: actions/cache@v3
72+
uses: actions/cache@v4
6373
with:
6474
path: cpython/builddir/wasi
6575
key: cpython-wasi

0 commit comments

Comments
 (0)