fmt #28
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, wasmm ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test-core: | |
name: Test Core Library | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: [stable, beta] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: readap | |
- name: Run core library tests | |
run: cargo test --manifest-path readap/Cargo.toml --verbose | |
test-wasm: | |
name: Test WASM Package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: readap-wasm | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Build WASM package | |
run: wasm-pack build readap-wasm --target web | |
- name: Test WASM package in headless browsers | |
run: wasm-pack test readap-wasm --headless --chrome --firefox | |
test-workspace: | |
name: Test Workspace | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check workspace | |
run: cargo check --workspace | |
- name: Test workspace | |
run: cargo test --workspace --verbose | |
cross-platform: | |
name: Cross Platform | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check core library | |
run: cargo check --manifest-path readap/Cargo.toml | |
- name: Check WASM target | |
run: cargo check --manifest-path readap-wasm/Cargo.toml --target wasm32-unknown-unknown | |
- name: Test core library | |
run: cargo test --manifest-path readap/Cargo.toml | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
targets: wasm32-unknown-unknown | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run clippy on workspace | |
run: cargo clippy --workspace -- -D warnings | |
- name: Run clippy on WASM target | |
run: cargo clippy --manifest-path readap-wasm/Cargo.toml --target wasm32-unknown-unknown -- -D warnings | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Check formatting | |
run: cargo fmt --all -- --check |