-
Notifications
You must be signed in to change notification settings - Fork 44
145 lines (121 loc) · 4.15 KB
/
test.yaml
File metadata and controls
145 lines (121 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Test
on:
pull_request:
branches: [main]
paths-ignore:
- "examples/**"
- "README.md"
- "CONTRIBUTING.md"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
WASI_SDK_VERSION: 30
jobs:
linux:
name: Populate cache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: "3.14.0"
- name: Install latest Rust nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-wasip1 wasm32-unknown-unknown
- name: Install latest Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip1 wasm32-unknown-unknown
components: clippy, rustfmt
- name: Install Rust std source
shell: bash
run: rustup component add rust-src --toolchain nightly
- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-${{ hashFiles('./Cargo.lock') }}"
cache-on-failure: false
- name: Install WASI-SDK
shell: bash
run: |
cd /tmp
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz
tar xf wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz
mv wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux /opt/wasi-sdk
- name: Build
shell: bash
run: cargo build --release
- name: Upload CPython builddir
uses: actions/upload-artifact@v4
with:
name: cpython-wasi
path: cpython/builddir/wasi
test:
name: Test
needs: linux
strategy:
fail-fast: false
matrix:
config:
- { os: "ubuntu-latest", wasiSDK: "x86_64-linux" }
- { os: "macos-latest", wasiSDK: "arm64-macos" }
- { os: "windows-latest", wasiSDK: "x86_64-windows" }
runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install latest Rust nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-wasip1 wasm32-unknown-unknown
- name: Install latest Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip1 wasm32-unknown-unknown
components: clippy, rustfmt
- name: Install Rust std source
shell: bash
run: rustup component add rust-src --toolchain nightly
- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-${{ hashFiles('./Cargo.lock') }}"
cache-on-failure: false
- name: Download WASI-SDK
shell: bash
run: |
cd /tmp
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }}.tar.gz
tar xf wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }}.tar.gz
- name: Install WASI-SDK
if: runner.os != 'Windows'
shell: bash
run: sudo mv /tmp/wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }} /opt/wasi-sdk
- name: Install WASI-SDK on Windows
if: runner.os == 'Windows'
shell: bash
run: echo "WASI_SDK_PATH=$(cygpath -m /tmp/wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }})" >> ${GITHUB_ENV}
- name: Restore CPython
uses: actions/download-artifact@v5
with:
name: cpython-wasi
path: cpython/builddir/wasi
- name: Lint
shell: bash
run: bash .github/workflows/lint.sh
- uses: taiki-e/install-action@v2
with:
tool: wasmtime-cli@43.0.0
- uses: actions/setup-python@v5
with:
python-version: "3.14.0"
- name: Test
shell: bash
run: COMPONENTIZE_PY_TEST_COUNT=20 PROPTEST_MAX_SHRINK_ITERS=0 cargo test --release