tarzan 0.2.2

Random-access, seekable .tar.zst archives with an embedded table-of-contents index
Documentation
name: CI

on:
  push:
  pull_request:

jobs:
  # Linux carries the OS-agnostic checks (fmt, clippy, the
  # THIRD-PARTY-LICENSES libzstd sanity check) on top of the test suite.
  # The other two jobs run the test suite only.
  check:
    name: lint + test (linux)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Verify THIRD-PARTY-LICENSES retains the libzstd entry
        run: |
          if ! grep -q '^- package_name: libzstd$' THIRD-PARTY-LICENSES \
             || ! grep -q 'Copyright (c) Meta Platforms' THIRD-PARTY-LICENSES; then
            echo "::error::THIRD-PARTY-LICENSES is missing the hand-maintained libzstd entry — re-add it after regenerating (see CONTRIBUTING.md)."
            exit 1
          fi

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

      - name: Check formatting
        run: cargo fmt --all --check

      - name: Clippy (warnings denied)
        run: cargo clippy --all-targets -- -D warnings

      - name: Test
        run: cargo test

  test-macos:
    name: test (macos)
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Test
        run: cargo test

  # Tests that touch Unix-only APIs (symlink creation, MetadataExt mtime,
  # Unix permission bits) are gated with `#[cfg(unix)]` and don't compile
  # in here. The remaining tests shell out to `tar`, which Windows
  # provides as bsdtar.
  test-windows:
    name: test (windows)
    runs-on: windows-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Test
        run: cargo test