|
14 | 14 |
|
15 | 15 | jobs: |
16 | 16 | client: |
17 | | - name: Build Client ${{ matrix.os.description }} |
| 17 | + name: |
| 18 | + Build Client ${{ matrix.os.description }} ${{ matrix.target.description }} ${{ |
| 19 | + matrix.target-feature.description }} |
18 | 20 |
|
19 | 21 | runs-on: ${{ matrix.os.os }} |
20 | 22 |
|
|
27 | 29 | - { os: ubuntu-latest, description: Linux } |
28 | 30 | - { os: macos-latest, description: MacOS } |
29 | 31 | - { os: windows-latest, description: Windows } |
| 32 | + target: |
| 33 | + - { target: wasm32-unknown-unknown, install: true, rust: stable, description: Wasm32 } |
| 34 | + - { |
| 35 | + target: wasm64-unknown-unknown, |
| 36 | + install: false, |
| 37 | + rust: nightly, |
| 38 | + components: -c rust-src, |
| 39 | + args: '-Zbuild-std="panic_abort,std"', |
| 40 | + description: Wasm64, |
| 41 | + } |
| 42 | + target-feature: |
| 43 | + - {} |
| 44 | + - { |
| 45 | + rust: nightly, |
| 46 | + components: -c rust-src, |
| 47 | + rustflags: -Ctarget-feature=+atomics -Clink-arg=--shared-memory, |
| 48 | + args: '-Zbuild-std="panic_abort,std"', |
| 49 | + description: Atomics, |
| 50 | + } |
30 | 51 |
|
31 | 52 | defaults: |
32 | 53 | run: |
|
36 | 57 | - name: Checkout |
37 | 58 | uses: actions/checkout@v4 |
38 | 59 | - name: Install Rust |
39 | | - run: rustup target add wasm32-unknown-unknown |
| 60 | + run: | |
| 61 | + rustup install --profile minimal ${{ matrix.target-feature.components || matrix.target.components }} ${{ matrix.target-feature.rust || matrix.target.rust }} |
| 62 | + rustup default ${{ matrix.target-feature.rust || matrix.target.rust }} |
| 63 | + - name: Install Target |
| 64 | + if: matrix.target.install |
| 65 | + run: rustup target add ${{ matrix.target.target }} |
| 66 | + - name: Set Target `RUSTFLAG` |
| 67 | + shell: bash |
| 68 | + run: | |
| 69 | + TARGET=$(echo "${{ matrix.target.target }}" | tr '[:lower:]-' '[:upper:]_') |
| 70 | + echo "CARGO_TARGET_${TARGET}_RUSTFLAGS=${{ matrix.target-feature.rustflags }}" >> $GITHUB_ENV |
40 | 71 | - name: Install LLVM |
41 | 72 | uses: ZhongRuoyu/setup-llvm@ec41d6e5f3c15c96fa642a49c6e7effac6261778 |
42 | 73 | with: |
|
46 | 77 | if: runner.os == 'macOS' |
47 | 78 | run: npm install -g typescript |
48 | 79 | - name: Build Crates |
49 | | - run: cargo build --workspace --all-features |
| 80 | + run: cargo build --workspace --target ${{ matrix.target.target }} ${{ matrix.target.args }} |
50 | 81 | - name: Build Examples |
51 | | - run: cargo build --examples --all-features |
| 82 | + run: |
| 83 | + cargo build --examples --target ${{ matrix.target.target }} ${{ matrix.target-feature.args |
| 84 | + || matrix.target.args }} |
0 commit comments