ripunzip 2.0.3

A tool to unzip an archive in parallel
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
  schedule: [cron: "40 1 * * *"]
  workflow_dispatch:

env:
  RUST_BACKTRACE: short
  # CI builds don't benefit very much from this and it has bugs
  CARGO_INCREMENTAL: 0
  # We can't use a debugger in CI, and this makes builds faster and the cache
  # smaller. (TODO: use -Cdebuginfo=0 if it doesn't make backtraces useless)
  RUSTFLAGS: -Cdebuginfo=1
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test ${{matrix.name || format('Rust {0}', matrix.rust)}}
    runs-on: ${{matrix.os || 'ubuntu'}}-latest

    strategy:
      fail-fast: false

      matrix:
        include:
          - rust: nightly
          - rust: beta
          - rust: stable
          - name: macOS
            rust: nightly
            os: macos
          - name: Windows (msvc)
            rust: nightly-x86_64-pc-windows-msvc
            os: windows
            flags: /EHsc
    env:
      CXXFLAGS: ${{matrix.flags}}
      RUSTFLAGS: --cfg deny_warnings -Dwarnings

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{matrix.rust}}
          components: rustfmt
      - name: Set up Rust Cache
        uses: Swatinem/rust-cache@v2
        with:
          shared-key: ripunzip
          cache-targets: true
          cache-all-crates: true
      - name: Install dependencies on Linux
        if: matrix.os == ''
        run: sudo apt-get install libssl-dev pkg-config
      - run: cargo test --locked --workspace ${{steps.testsuite.outputs.exclude}}

  deb:
    name: Build Deb
    runs-on: ubuntu-22.04
    env:
      CARGO_TERM_COLOR: always
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: cargo-bins/cargo-binstall@main
      - run: cargo binstall cargo-deb --no-confirm # sadly not supported by dtolnay/install
      - name: Build Deb
        run: cargo deb -- --locked
      - name: Upload Deb Artifact
        uses: actions/upload-artifact@v4
        with:
          name: amd64deb
          path: ./target/debian/*.deb

  # Clippy check
  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    env:
      CARGO_TERM_COLOR: always
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Set up Rust Cache
        uses: Swatinem/rust-cache@v2
        with:
          shared-key: ripunzip
          cache-targets: true
          cache-all-crates: true

      - run: cargo clippy --workspace --tests -- -Dclippy::all

  # Mention outdated dependencies
  outdated:
    name: Outdated
    runs-on: ubuntu-latest
    env:
      CARGO_TERM_COLOR: always
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/install@cargo-outdated

      - run: cargo outdated -R -w

  # Check rustfmt is good
  fmt:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - run: cargo fmt --all -- --check

  # Detect cases where documentation links don't resolve and such.
  doc:
    name: Docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Set up Rust Cache
        uses: Swatinem/rust-cache@v2
        with:
          shared-key: ripunzip
          cache-targets: true
          cache-all-crates: true

      - run: |
          for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .name'); do
            cargo rustdoc --color always -p "$package" -- -D warnings
          done
        env: { RUSTDOCFLAGS: -Dwarnings }