sorug 0.6.2

Ultra-high-performance, zero-copy, WHATWG-compliant URL parser
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

# Least privilege: read sources; write caches used by rust-cache.
permissions:
  contents: read
  actions: write

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - name: Test (default features)
        run: cargo test --all-targets
      - name: Test (all features)
        run: cargo test --all-targets --all-features
      - name: Test no_std + alloc (lib)
        run: cargo test --lib --no-default-features
      - name: Check no_std + alloc
        run: cargo check --no-default-features
      - name: Check no_std + alloc + serde
        run: cargo check --no-default-features --features serde
      - name: Check http feature
        run: cargo check --features http
      - name: Test FFI crate
        run: cargo test -p sorug-ffi
      - name: Format
        run: cargo fmt --all -- --check
      - name: Clippy
        run: cargo clippy --workspace --all-targets --all-features -- -D warnings -A clippy::pedantic

  msrv:
    name: msrv
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@1.85.0
      - uses: Swatinem/rust-cache@v2
        with:
          key: msrv
      - name: Check MSRV 1.85
        run: cargo check --all-features
      - name: Check MSRV no_std
        run: cargo check --no-default-features

  wasm:
    name: wasm no_std
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: wasm32-unknown-unknown
      - uses: Swatinem/rust-cache@v2
        with:
          key: wasm
      - name: Check wasm32 no_std
        run: cargo check --no-default-features --target wasm32-unknown-unknown
      - name: Check wasm32 no_std + serde
        run: cargo check --no-default-features --features serde --target wasm32-unknown-unknown
      # Compile lib under cfg(test) without the test harness (avoids ada-url/WASI SDK).
      - name: Compile wasm32 lib with cfg(test) smoke
        run: cargo rustc --lib --no-default-features --target wasm32-unknown-unknown -- --cfg test
      - name: Compile wasm32 lib + serde with cfg(test) smoke
        run: cargo rustc --lib --no-default-features --features serde --target wasm32-unknown-unknown -- --cfg test

  deny:
    name: cargo-deny
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: EmbarkStudios/cargo-deny-action@v2
        with:
          command: check
          arguments: --all-features