Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/znippy

.github/workflows/ci.yml

name: CI

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  build-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install stable toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: ${{ runner.os }}-cargo-

      - name: Build workspace
        run: cargo build --workspace --verbose

      # Tests run with --workspace. The decompressor benches pull real Maven
      # Central JARs (cached) and are not part of `cargo test`, so unit/integration
      # tests stay network-free here.
      # `maven_native_wasm_agree` loads a REAL .wasm through the real WasmPlugin
      # loader and is deliberately impossible to pass without a fresh one — it
      # says so itself, and names this exact command. CI never ran it, so the
      # test could not pass here no matter what the code did.
      - name: Build the wasm the agreement test loads
        run: |
          rustup target add wasm32-unknown-unknown
          cargo build --target wasm32-unknown-unknown --release -p znippy-plugin-maven-wasm

      - name: Test workspace
        run: cargo test --workspace --verbose

  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install stable toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt

      # Informational: the workspace is not fully fmt/clippy-clean yet, so these
      # do not fail the build (no `-D warnings`).
      - name: Clippy
        run: cargo clippy --workspace --all-targets
        continue-on-error: true

      - name: Rustfmt
        run: cargo fmt --all -- --check
        continue-on-error: true