Noerrnoclear #91
Workflow file for this run
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: Rust | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Install Emscripten for WASM tests | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y emscripten | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-emscripten | |
| # Cache cargo dependencies | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ matrix.os }}-cargo- | |
| - name: Build | |
| run: cargo build --verbose | |
| - name: Run tests | |
| run: cargo test --verbose | |
| - name: Build | |
| if: matrix.os == 'ubuntu-latest' | |
| run: cargo build --verbose --target wasm32-unknown-emscripten | |
| - name: Run tests | |
| if: matrix.os == 'ubuntu-latest' | |
| run: cargo test --verbose --target wasm32-unknown-emscripten | |
| # Tarpaulin (coverage) only runs on Linux | |
| - name: Check coverage | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| which cargo-tarpaulin || cargo install cargo-tarpaulin | |
| cargo tarpaulin |