Skip to content

Commit

Permalink
Deduplicate some CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Systemcluster committed Aug 8, 2024
1 parent 42cecfa commit ece81e5
Showing 1 changed file with 60 additions and 137 deletions.
197 changes: 60 additions & 137 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ jobs:
- run: for i in examples/*/; do cd "$i"; cargo +stable clippy --no-deps --all-features --target wasm32-unknown-unknown -- -D warnings || exit 1; cd ../..; done

test_wasm_bindgen:
strategy:
matrix:
runs:
- |
cargo test --target wasm32-unknown-unknown
cargo test --target wasm32-unknown-unknown -p wasm-bindgen-futures
- cargo test --target wasm32-unknown-unknown --features serde-serialize
- cargo test --target wasm32-unknown-unknown --features enable-interning
name: "Run wasm-bindgen crate tests (unix)"
runs-on: ubuntu-latest
env:
Expand All @@ -105,38 +113,7 @@ jobs:
with:
node-version: '20'
- uses: ./.github/actions/setup-geckodriver
- run: cargo test --target wasm32-unknown-unknown
- run: cargo test --target wasm32-unknown-unknown -p wasm-bindgen-futures

test_wasm_bindgen_feature_serde:
name: "Run wasm-bindgen crate tests with serde-serialize feature"
runs-on: ubuntu-latest
env:
WASM_BINDGEN_SPLIT_LINKED_MODULES: 1
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: ./.github/actions/setup-geckodriver
- run: cargo test --target wasm32-unknown-unknown --features serde-serialize

test_wasm_bindgen_feature_interning:
name: "Run wasm-bindgen crate tests with enable-interning feature"
runs-on: ubuntu-latest
env:
WASM_BINDGEN_SPLIT_LINKED_MODULES: 1
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: ./.github/actions/setup-geckodriver
- run: cargo test --target wasm32-unknown-unknown --features enable-interning
- run: ${{ matrix.runs }}

test_wasm_bindgen_wasm:
name: "Run wasm-bindgen wasm test"
Expand All @@ -154,11 +131,22 @@ jobs:
env:
WASM_BINDGEN_NO_DEBUG: 1

test_wasm_bindgen_externref:
name: "Run wasm-bindgen crate tests with various environment variables"
test_wasm_bindgen_features:
strategy:
matrix:
envs:
- name: "externref"
env:
WASM_BINDGEN_EXTERNREF: 1
- name: "multi-value"
env:
WASM_BINDGEN_MULTI_VALUE: 1
name: "Run wasm-bindgen crate tests with ${{ matrix.envs.name }} feature"
runs-on: ubuntu-latest
env:
WASM_BINDGEN_SPLIT_LINKED_MODULES: 1
WASM_BINDGEN_EXTERNREF: ${{ matrix.envs.WASM_BINDGEN_EXTERNREF }}
WASM_BINDGEN_MULTI_VALUE: ${{ matrix.envs.WASM_BINDGEN_MULTI_VALUE }}
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
Expand All @@ -167,24 +155,6 @@ jobs:
with:
node-version: '20'
- run: cargo test --target wasm32-unknown-unknown
env:
WASM_BINDGEN_EXTERNREF: 1

test_wasm_bindgen_multi_value:
name: "Run wasm-bindgen crate tests with various environment variables"
runs-on: ubuntu-latest
env:
WASM_BINDGEN_SPLIT_LINKED_MODULES: 1
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: cargo test --target wasm32-unknown-unknown
env:
WASM_BINDGEN_MULTI_VALUE: 1

test_threads:
name: "Run wasm-bindgen crate tests with multithreading"
Expand Down Expand Up @@ -242,8 +212,44 @@ jobs:
- run: cargo test -p wasm-bindgen-futures
- run: cargo test -p wasm-bindgen-shared

test_web_sys:
name: "Run web-sys crate tests"
test_node:
strategy:
matrix:
runs:
- name: "web-sys"
run: |
run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown
run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Node
run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Element
run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Window
- name: "js-sys (all features)"
run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features
- name: "js-sys (unstable, all features)"
run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
- name: "js-sys"
run: cargo test -p js-sys --target wasm32-unknown-unknown
- name: "js-sys (unstable)"
run: cargo test -p js-sys --target wasm32-unknown-unknown
env:
RUSTFLAGS: --cfg=js_sys_unstable_apis
- name: "wasm-bindgen-webidl"
run: cargo test -p wasm-bindgen-webidl
- name: "webidl-tests"
run: cargo test -p wasm-bindgen-webidl --target wasm32-unknown-unknown
env:
WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: 1
- name: "webidl-tests (unstable)"
run: cargo test -p wasm-bindgen-webidl --target wasm32-unknown-unknown
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
- name: "typescript-tests"
run: cd crates/typescript-tests && ./run.sh
name: "Run ${{ matrix.runs.name }} tests"
env:
RUSTFLAGS: ${{ matrix.runs.env.RUSTFLAGS }}
WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: ${{ matrix.runs.env.WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -258,89 +264,6 @@ jobs:
- run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Element
- run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Window

test_web_sys_all_features:
name: "Run web-sys crate tests with all features"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: ./.github/actions/setup-geckodriver
- run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features

test_web_sys_all_features_unstable:
name: "Run web-sys crate tests with all features and unstable APIs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: ./.github/actions/setup-geckodriver
- run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis

check_web_sys:
name: "Verify that web-sys is compiled correctly"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: cd crates/web-sys && cargo run --release --package wasm-bindgen-webidl -- webidls src/features ./Cargo.toml
- run: git diff --exit-code

test_js_sys:
name: "Run js-sys crate tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: ./.github/actions/setup-geckodriver
- run: cargo test -p js-sys --target wasm32-unknown-unknown
- run: cargo test -p js-sys --target wasm32-unknown-unknown
env:
RUSTFLAGS: --cfg=js_sys_unstable_apis

test_webidl:
name: "Run wasm-bindgen-webidl crate tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: cargo test -p wasm-bindgen-webidl
- run: cargo test -p webidl-tests --target wasm32-unknown-unknown
env:
WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: 1
- run: cargo test -p webidl-tests --target wasm32-unknown-unknown
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis

test_typescript_output:
name: "Test TypeScript output of wasm-bindgen"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: cd crates/typescript-tests && ./run.sh

test_deno:
name: "Build and test the deno example"
runs-on: ubuntu-latest
Expand Down

0 comments on commit ece81e5

Please sign in to comment.