name: 🧪 Tests and Checks on: push: branches: [ main ] pull_request: branches: [ '**' ] jobs: rust-checks: runs-on: ubuntu-latest strategy: fail-fast: false matrix: rust-toolchain: - 1.75 - nightly steps: - name: Checkout Repository uses: actions/checkout@v4 # Smarter caching action, speeds up build times compared to regular cache: # https://github.com/Swatinem/rust-cache - name: Cache Project uses: Swatinem/rust-cache@v2 # Widely adopted suite of Rust-specific boilerplate actions, especially # toolchain/cargo use: https://actions-rs.github.io/ - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 with: override: true components: rustfmt, clippy toolchain: ${{ matrix.rust-toolchain }} - name: Check Format uses: actions-rs/cargo@v1 with: args: --all -- --check command: fmt toolchain: ${{ matrix.rust-toolchain }} - name: Run Linter uses: actions-rs/cargo@v1 with: args: --workspace -- -D warnings command: clippy toolchain: ${{ matrix.rust-toolchain }} # Check for security advisories. - name: Check Advisories if: ${{ matrix.rust-toolchain == 'stable' }} uses: EmbarkStudios/cargo-deny-action@v1 with: command: check advisories continue-on-error: true # Audit licenses, unreleased crates, and unexpected duplicate versions. - name: Check Bans, Licenses, and Sources if: ${{ matrix.rust-toolchain == 'stable' }} uses: EmbarkStudios/cargo-deny-action@v1 with: command: check bans licenses sources # Only "test" release build on push event. - name: Test Release if: github.event_name == 'push' run: cargo build --release rust-tests: runs-on: ubuntu-latest strategy: fail-fast: false matrix: rust-toolchain: - 1.75 - nightly steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Cache Project uses: Swatinem/rust-cache@v2 - name: Run Tests # 3MB of stack space run: RUST_MIN_STACK=3000000 cargo test --all-features wasm-js-tests: strategy: fail-fast: false matrix: rust-toolchain: - 1.75 - nightly runs-on: macos-latest defaults: run: working-directory: ./wnfs-wasm steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Cache Project (JavaScript) uses: actions/setup-node@v4 with: node-version: '16.x' - name: Cache Project (Rust) uses: Swatinem/rust-cache@v2 - name: Install Wasm Bindgen CLI uses: "actions-rs/cargo@v1" with: args: "--force wasm-bindgen-cli" command: install - name: Install Binaryen run: brew install binaryen - name: Setup WebAssembly Toolchain run: rustup target add wasm32-unknown-unknown - name: Install Node Dependencies run: yarn - name: Install Playwright run: npx playwright install --with-deps - name: Build run: yarn run build - name: Run Playwright Tests run: yarn run test