hpke-dispatch 0.8.0

runtime algorithmic selection for hybrid public key encryption
Documentation
name: CI

on:
  pull_request:
  push:
    branches:
      - main

jobs:
  test:
    name: Build and Test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
        rust: [stable, nightly]
    env:
      # This environment variable would override the RUSTFLAGS value set in .config/cargo.toml when
      # building for WASM. Thus, we only use it on host builds.
      RUSTFLAGS: -Dwarnings
    steps:
    - uses: actions/checkout@v4
    - name: Install ${{ matrix.rust }}
      uses: actions-rs/toolchain@v1
      with:
        toolchain: ${{ matrix.rust }}
        override: true

    - name: Rust Cache
      uses: Swatinem/rust-cache@v2.8.0

    - name: Run tests
      uses: actions-rs/cargo@v1
      with:
        command: test
        args: --all --no-fail-fast

  check_fmt_and_docs:
    name: Lints and Docs
    runs-on: ubuntu-latest
    env:
      # This environment variable would override the RUSTFLAGS value set in .config/cargo.toml when
      # building for WASM. Thus, we only use it on host builds.
      RUSTFLAGS: -Dwarnings
    steps:
    - uses: actions/checkout@v4
    - uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
        components: rustfmt, clippy
        override: true

    - uses: actions-rs/clippy-check@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        
    - name: Format
      run: cargo fmt --all -- --check

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



  wasm-pack:
    name: Wasm stuff
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions-rs/toolchain@v1
      with:
        toolchain: nightly
        override: true
        target: wasm32-unknown-unknown
    - uses: actions/setup-node@v4
      with:
        node-version: "22"
    - name: install cargo-binstall
      uses: cargo-bins/cargo-binstall@v1.12.6
    - name: install wasm-pack
      run: cargo binstall wasm-pack --version 0.13.1
    - name: build with default features
      run: wasm-pack build
    - name: node test
      run: wasm-pack test --node
  js:
    name: TS tests
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: "22"
    - run: npm ci
    - run: npm run build
    - run: npm run test