4646 run : cargo test --all-features --no-fail-fast
4747
4848 client :
49- name : Test Client ${{ matrix.os.description }}
49+ name :
50+ Test Client ${{ matrix.os.description }} ${{ matrix.target.description }} ${{
51+ matrix.target-feature.description }} ${{ matrix.runner.description }}
5052
5153 runs-on : ${{ matrix.os.os }}
5254
5961 - { os: ubuntu-latest, description: Linux }
6062 - { os: macos-latest, description: MacOS }
6163 - { os: windows-latest, description: Windows }
64+ target :
65+ - { target: wasm32-unknown-unknown, install: true, rust: stable, description: Wasm32 }
66+ - {
67+ target : wasm64-unknown-unknown,
68+ install : false,
69+ rust : nightly,
70+ components : -c rust-src,
71+ args : ' -Zbuild-std="panic_abort,std"' ,
72+ description : Wasm64,
73+ }
74+ target-feature :
75+ - {}
76+ - {
77+ rust : nightly,
78+ components : -c rust-src,
79+ rustflags : -Ctarget-feature=+atomics -Clink-arg=--shared-memory,
80+ args : ' -Zbuild-std="panic_abort,std"' ,
81+ description : Atomics,
82+ }
83+ runner :
84+ - { runner: node-js, description: NodeJs }
85+ - { runner: deno, description: Deno }
86+ - { runner: browser, browser: chromedriver, description: Chrome }
87+ - { runner: browser, browser: geckodriver, description: Firefox }
88+ - { runner: browser, browser: safaridriver, description: Safari }
89+ exclude :
90+ - os : { os: ubuntu-latest, description: Linux }
91+ runner : { runner: browser, browser: safaridriver }
92+ - os : { os: windows-latest, description: Windows }
93+ runner : { runner: browser, browser: safaridriver, description: Safari }
6294
6395 defaults :
6496 run :
@@ -68,19 +100,39 @@ jobs:
68100 - name : Checkout
69101 uses : actions/checkout@v4
70102 - name : Install Rust
71- run : rustup target add wasm32-unknown-unknown
103+ run : |
104+ rustup install --profile minimal ${{ matrix.target-feature.components || matrix.target.components }} ${{ matrix.target-feature.rust || matrix.target.rust }}
105+ rustup default ${{ matrix.target-feature.rust || matrix.target.rust }}
106+ - name : Install Target
107+ if : matrix.target.install
108+ run : rustup target add ${{ matrix.target.target }}
109+ - name : Set Target `RUSTFLAG`
110+ shell : bash
111+ run : |
112+ TARGET=$(echo "${{ matrix.target.target }}" | tr '[:lower:]-' '[:upper:]_')
113+ echo "CARGO_TARGET_${TARGET}_RUSTFLAGS=${{ matrix.target-feature.rustflags }}" >> $GITHUB_ENV
72114 - name : Install LLVM
73115 uses : ZhongRuoyu/setup-llvm@ec41d6e5f3c15c96fa642a49c6e7effac6261778
74116 with :
75117 # Rustc v1.93
76118 llvm-version : 21
77119 - name : Install TSC
78- if : runner.os == 'macOS'
120+ if : runner.os == 'macOS' || runner.os == 'Windows'
79121 run : npm install -g typescript
122+ - name : Set Test Runner
123+ run : echo "JBG_TEST_RUNNER=${{ matrix.runner.runner }}" >> $GITHUB_ENV
124+ - name : Set Test WebDriver
125+ if : matrix.runner.browser
126+ shell : bash
127+ run : |
128+ DRIVER=$(echo "${{ matrix.runner.browser }}" | tr '[:lower:]' '[:upper:]')
129+ echo "BG_TEST_${DRIVER}=${{ matrix.runner.browser }}" >> $GITHUB_ENV
80130 - name : Update Node.js
81131 if : runner.os == 'Linux' || runner.os == 'macOS'
82132 uses : actions/setup-node@v6
83133 with :
84134 node-version : latest
85135 - name : Run Tests
86- run : cargo test --workspace --all-features --no-fail-fast
136+ run :
137+ cargo test --workspace --all-features --no-fail-fast --target ${{ matrix.target.target }}
138+ ${{ matrix.target-feature.args || matrix.target.args }}
0 commit comments