wacc 2.2.0

Web Assembly Cryptographic Constructs VM implementation
name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust Toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
          targets: wasm32-wasip2

      - name: Pin pkcs1 to 0.8.0-rc.4
        # sad-rsa 0.2.3 (pulled in through multi-key) fails to compile against
        # pkcs1 0.8.0-rc.5, which added a type parameter to RsaPublicKey.
        # Pin the last working pkcs1 pre-release until sad-rsa ships a release
        # compatible with it, then remove this step.
        run: cargo update -p pkcs1 --precise 0.8.0-rc.4

      - name: Check Code Format
        run: cargo fmt --all -- --check

      - name: Code Lint
        run: cargo clippy --all-targets -- -D warnings

      - name: Build
        run: cargo build --verbose

      - name: Build Script Fixtures
        run: make -C examples/wacc/wast guests

      - name: Run tests
        run: cargo test --verbose

      - name: Documentation
        run: cargo doc --no-deps

  msrv:
    name: Verify MSRV (1.96)
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust Toolchain (1.96)
        uses: dtolnay/rust-toolchain@1.96.0

      - name: Pin pkcs1 to 0.8.0-rc.4
        # Same mitigation as in the build job: sad-rsa 0.2.3 fails to compile
        # against pkcs1 0.8.0-rc.5. Remove this step when sad-rsa ships a
        # compatible release.
        run: cargo update -p pkcs1 --precise 0.8.0-rc.4

      - name: Check
        run: cargo check