Skip to content

Commit 016a857

Browse files
authored
fix wasi ci testing and update doc in README (#367)
* Speedup exhaustive.yml Do not run cargo-hack on all crates, since codecs features are subset of async-compression features Signed-off-by: Jiahao XU <[email protected]> * ci: speedup clippy in lint.yml Do not run clippy on dependencies Signed-off-by: Jiahao XU <[email protected]> * ci: speedup clippy in nightly.yml Do not run clippy on dependencies Signed-off-by: Jiahao XU <[email protected]> * Use latest wasi sysroot in wasi.yml And use cargo-check instead of cargo-build Signed-off-by: Jiahao XU <[email protected]> * Update README.md for wasi testing Signed-off-by: Jiahao XU <[email protected]> * Speedup cargo-hack in exhaustive.yml Signed-off-by: Jiahao XU <[email protected]> * Fix exhaustive.yml Signed-off-by: Jiahao XU <[email protected]> * Speedup exhaustive.yml Signed-off-by: Jiahao XU <[email protected]> * Fix exhaustive.yml Signed-off-by: Jiahao XU <[email protected]> * Fix exhaustive.yml Signed-off-by: Jiahao XU <[email protected]> * Speedup exhaustive.yml Limit powerser depth to 4 Signed-off-by: Jiahao XU <[email protected]> * Fix wasi.yml Signed-off-by: Jiahao XU <[email protected]> --------- Signed-off-by: Jiahao XU <[email protected]>
1 parent ceae00f commit 016a857

File tree

5 files changed

+61
-21
lines changed

5 files changed

+61
-21
lines changed

.github/workflows/exhaustive.yml

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ jobs:
7373
- run: cargo --locked test --workspace --doc --all-features
7474
7575
check-features:
76-
name: cargo hack check --feature-powerset
76+
strategy:
77+
matrix:
78+
async_runtime: [tokio, futures-io]
79+
name: cargo hack check --feature-powerset --features ${{ matrix.async_runtime }}
7780
runs-on: ubuntu-latest
7881
env:
7982
RUSTFLAGS: -Dwarnings
@@ -82,15 +85,23 @@ jobs:
8285
- uses: actions-rust-lang/setup-rust-toolchain@v1
8386
- uses: taiki-e/install-action@v2
8487
with: { tool: cargo-hack }
85-
- run:
86-
cargo hack check
87-
--workspace
88-
--feature-powerset
89-
--no-dev-deps
90-
--skip 'all,all-algorithms,all-implementations'
88+
- name: cargo-hack check
89+
run: |
90+
set -exuo pipefail
91+
skipped_features=$(echo 'futures-io,tokio,' | sed 's/${{ matrix.async_runtime }},//')
92+
cargo hack check \
93+
--feature-powerset \
94+
--features ${{ matrix.async_runtime }} \
95+
--no-dev-deps \
96+
--skip "all,all-algorithms,${skipped_features}all-implementations,xz-parallel,zstdmt" \
97+
--depth 4
98+
cargo check --features ${{ matrix.async_runtime }},xz-parallel,zstdmt
9199

92100
check-test-features:
93-
name: cargo hack check --all-targets --feature-powerset
101+
strategy:
102+
matrix:
103+
async_runtime: [tokio, futures-io]
104+
name: cargo check --all-targets --feature-powerset --features ${{ matrix.async_runtime }}
94105
runs-on: ubuntu-latest
95106
env:
96107
RUSTFLAGS: -Dwarnings
@@ -99,12 +110,34 @@ jobs:
99110
- uses: actions-rust-lang/setup-rust-toolchain@v1
100111
- uses: taiki-e/install-action@v2
101112
with: { tool: cargo-hack }
102-
- run:
103-
cargo hack check
104-
--workspace
105-
--feature-powerset
106-
--all-targets
107-
--skip 'all,all-algorithms,all-implementations'
113+
- name: cargo-hack check
114+
run: |
115+
set -exuo pipefail
116+
skipped_features=$(echo 'futures-io,tokio,' | sed 's/${{ matrix.async_runtime }},//')
117+
cargo hack check \
118+
--feature-powerset \
119+
--features ${{ matrix.async_runtime }} \
120+
--all-targets \
121+
--skip "all,all-algorithms,${skipped_features}all-implementations,xz-parallel,zstdmt" \
122+
--depth 4
123+
cargo check --all-targets --features ${{ matrix.async_runtime }},xz-parallel,zstdmt
124+
125+
# Dummy job to have a stable name for the "all tests pass" requirement
126+
tests-pass:
127+
name: Exhaustive tests pass
128+
needs:
129+
- test
130+
- min-versions-shallow
131+
- min-versions
132+
- check-features
133+
- check-test-features
134+
if: always() # always run even if dependencies fail
135+
runs-on: ubuntu-latest
136+
steps:
137+
# fail if ANY dependency has failed or cancelled
138+
- if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')"
139+
run: exit 1
140+
- run: exit 0
108141

109142
on:
110143
merge_group:

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v5
2121
- uses: actions-rust-lang/setup-rust-toolchain@v1
2222
with: { components: clippy }
23-
- run: cargo --locked clippy --all --all-targets --all-features -- -D warnings
23+
- run: cargo --locked clippy --no-deps --all --all-targets --all-features -- -D warnings
2424

2525
on:
2626
merge_group:

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
toolchain: nightly
3939
components: clippy
40-
- run: cargo --locked clippy --all --all-targets --all-features -- -D warnings
40+
- run: cargo --locked clippy --no-deps --all --all-targets --all-features -- -D warnings
4141

4242
on:
4343
schedule:

.github/workflows/wasi.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ jobs:
1313
with:
1414
toolchain: nightly
1515
target: wasm32-wasip1-threads
16-
- run: |
17-
curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sysroot-25.0.tar.gz -o wasi-sysroot.tar.gz
16+
- run: gh release download --repo WebAssembly/wasi-sdk --pattern 'wasi-sysroot-*.tar.gz'
17+
env:
18+
GH_TOKEN: ${{ github.token }}
19+
- name: Extract wasi-sysroot
20+
run: |
1821
mkdir -p wasi-sysroot
19-
tar xf wasi-sysroot.tar.gz --strip-components=1 -C wasi-sysroot
22+
tar xf wasi-sysroot-*.tar.gz --strip-components=1 -C wasi-sysroot
2023
- run: |
21-
export "CFLAGS_wasm32_wasip1_threads=--sysroot=${{ github.workspace }}/wasi-sysroot -I${{ github.workspace }}/wasi-sysroot/include/wasm32-wasip1-threads -L-I${{ github.workspace }}/wasi-sysroot/lib/wasm32-wasip1-threads"
22-
cargo +nightly build --lib --features all-implementations,brotli,bzip2,deflate,gzip,lz4,lzma,xz,zlib,zstd,deflate64 --target wasm32-wasip1-threads
24+
cargo +nightly check --lib --features all-implementations,brotli,bzip2,deflate,gzip,lz4,lzma,xz,zlib,zstd,deflate64 --target wasm32-wasip1-threads
25+
env:
26+
CFLAGS_wasm32_wasip1_threads: --sysroot=${{ github.workspace }}/wasi-sysroot -I${{ github.workspace }}/wasi-sysroot/include/wasm32-wasip1-threads -L-I${{ github.workspace }}/wasi-sysroot/lib/wasm32-wasip1-threads
2327
2428
on:
2529
merge_group:

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ To prepare for a pull request, you can run several other checks:
5151

5252
```bash
5353
gh release download --repo WebAssembly/wasi-sdk --pattern 'wasi-sysroot-*.tar.gz'
54+
mkdir -p wasi-sysroot
55+
tar xf wasi-sysroot-*.tar.gz --strip-components=1 -C wasi-sysroot
56+
5457
rustup target add wasm32-wasip1-threads
5558
5659
export "CFLAGS_wasm32_wasip1_threads=--sysroot=\"${PWD}/wasi-sysroot\" -I\"${PWD}/wasi-sysroot/include/wasm32-wasip1-threads\" -L-I\"${PWD}/wasi-sysroot/lib/wasm32-wasip1-threads\""

0 commit comments

Comments
 (0)