salvo-http3 0.7.0

Http3 for salvo web framework
Documentation
name: CI
on:
  pull_request:
  push:
    branches:
      - master

env:
  RUST_BACKTRACE: 1
  toolchain_style: stable
  toolchain_msrv: 1.70.0
  toolchain_h3_quinn_msrv: 1.71.0
  toolchain_doc: nightly-2024-12-02
  toolchain_lint: stable
  toolchain_fuzz: nightly-2024-12-02

jobs:
  ci-pass:
    name: CI is green
    runs-on: ubuntu-latest
    needs:
      - style
      - lint
      - msrv
      - test
      - doc
      - fuzz
    steps:
      - run: exit 0

  style:
    name: Check Style
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust ${{ env.toolchain_style }}
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.toolchain_style }}
          override: true
          components: rustfmt
      - uses: Swatinem/rust-cache@v2
      - name: cargo fmt --all -- --check
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust ${{ env.toolchain_lint }}
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.toolchain_lint }}
          override: true
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - name: cargo clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy

  msrv:
    name: Check MSRV
    needs: [style]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust ${{ env.toolchain_msrv }}
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.toolchain_msrv }}
          override: true
      - uses: Swatinem/rust-cache@v2
      - name: cargo check -p salvo-http3
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: -p salvo-http3


  test:
    name: Test ${{ matrix.toolchain }} ${{ matrix.os }}
    needs: [style]
    strategy:
      matrix:
        os: [ubuntu-latest]
        toolchain: [stable, beta]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust ${{ matrix.toolchain }}
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.toolchain }}
          override: true
      - uses: Swatinem/rust-cache@v2
      - name: cargo test
        uses: actions-rs/cargo@v1
        with:
          command: test
      - name: h3Spec
        run: ./ci/h3spec.sh
        if: matrix.toolchain == 'stable'

  doc:
    name: Build docs
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust ${{ env.toolchain_doc }}
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.toolchain_doc }}
          override: true
      - uses: Swatinem/rust-cache@v2
      - name: cargo rustdoc -p h3 -- -D intra-doc-link-resolution-failure
        uses: actions-rs/cargo@v1
        with:
          command: rustdoc
          args: -p h3 -- -D intra-doc-link-resolution-failure

  fuzz:
    name: Fuzz test
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust ${{ env.toolchain_fuzz }}
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.toolchain_fuzz }}
          override: true
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-fuzz
        uses: camshaft/install@v1
        with:
          crate: cargo-fuzz
      - name: cargo fuzz run fuzz_varint -- -runs=1
        uses: actions-rs/cargo@v1
        with:
          command: fuzz
          args: run fuzz_varint -- -runs=1

  compliance:
    name: Compliance report
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          persist-credentials: false
          fetch-depth: 0
      - name: Generate compliance report
        uses: ./.github/actions/compliance
        with:
          extract-script: ${{ github.workspace }}/ci/compliance/extract.sh
          report-script: ${{ github.workspace }}/ci/compliance/report.sh