Update README.md #15
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build-wasm: | |
| name: Build WebAssembly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: "rustfmt,clippy" | |
| - name: Install wasm target | |
| run: rustup target add wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack | |
| - name: Build WASM bundle | |
| run: wasm-pack build --target web --dev | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| - name: npm ci & build | |
| run: npm ci && npm run build | |
| test: | |
| name: Lint & Test (native) | |
| runs-on: ubuntu-latest | |
| needs: build-wasm | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Rust (native) | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: "rustfmt,clippy" | |
| - name: Run rustfmt check | |
| run: cargo fmt -- --check | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -A deprecated | |
| - name: Run tests | |
| run: cargo test --all -- --nocapture |