Expand CI #195
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| client: | |
| name: | |
| Build Client ${{ matrix.os.description }} ${{ matrix.target.description }} ${{ | |
| matrix.target-feature.description }} | |
| runs-on: ${{ matrix.os.os }} | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - { os: ubuntu-latest, description: Linux } | |
| - { os: macos-latest, description: MacOS } | |
| - { os: windows-latest, description: Windows } | |
| target: | |
| - { target: wasm32-unknown-unknown, install: true, rust: stable, description: Wasm32 } | |
| - { | |
| target: wasm64-unknown-unknown, | |
| install: false, | |
| rust: nightly, | |
| components: -c rust-src, | |
| args: '-Zbuild-std="panic_abort,std"', | |
| description: Wasm64, | |
| } | |
| target-feature: | |
| - {} | |
| - { | |
| rust: nightly, | |
| components: -c rust-src, | |
| rustflags: -Ctarget-feature=+atomics -Clink-arg=--shared-memory, | |
| args: '-Zbuild-std="panic_abort,std"', | |
| description: Atomics, | |
| } | |
| defaults: | |
| run: | |
| working-directory: client | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| run: | | |
| rustup install --profile minimal ${{ matrix.target-feature.components || matrix.target.components }} ${{ matrix.target-feature.rust || matrix.target.rust }} | |
| rustup default ${{ matrix.target-feature.rust || matrix.target.rust }} | |
| - name: Install Target | |
| if: matrix.target.install | |
| run: rustup target add ${{ matrix.target.target }} | |
| - name: Set Target `RUSTFLAG` | |
| shell: bash | |
| run: | | |
| TARGET=$(echo "${{ matrix.target.target }}" | tr '[:lower:]-' '[:upper:]_') | |
| echo "CARGO_TARGET_${TARGET}_RUSTFLAGS=${{ matrix.target-feature.rustflags }}" >> $GITHUB_ENV | |
| - name: Install LLVM | |
| uses: ZhongRuoyu/setup-llvm@ec41d6e5f3c15c96fa642a49c6e7effac6261778 | |
| with: | |
| # Rustc v1.93 | |
| llvm-version: 21 | |
| - name: Install TSC | |
| if: runner.os == 'macOS' | |
| run: npm install -g typescript | |
| - name: Build Crates | |
| run: cargo build --workspace --target ${{ matrix.target.target }} ${{ matrix.target.args }} | |
| - name: Build Examples | |
| run: | |
| cargo build --examples --target ${{ matrix.target.target }} ${{ matrix.target-feature.args | |
| || matrix.target.args }} |