nisaba 0.2.4

Data quality, reconciliation, and validation across different data stores
Documentation
name: Security and Dependencies

on:
  schedule:
    # Run security audit once a week at 00:00 UTC Sundays
    - cron: "0 0 * * 0"

  push:
    branches: [main]
    paths:
      - "**/Cargo.toml"
      - "**/Cargo.lock"
  pull_request:
    paths:
      - "**/Cargo.toml"
      - "**/Cargo.lock"

env:
  CARGO_TERM_COLOR: always

jobs:
  audit:
    name: "cargo-audit"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6

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

      - name: Install cargo-audit
        uses: taiki-e/install-action@cargo-audit

      - name: Run cargo audit
        run: cargo audit

      - name: Run cargo audit (JSON output)
        run: cargo audit --json > audit-results.json
        continue-on-error: true

      - name: Upload audit results
        uses: actions/upload-artifact@v5
        if: always()
        with:
          name: security-audit-results
          path: audit-results.json

  vet:
    name: cargo-vet
    runs-on: ubuntu-latest
    env:
      CARGO_VET_VERSION: 0.10.2

    steps:
      - uses: actions/checkout@master
      - name: Install Rust
        run: rustup update stable && rustup default stable

      - uses: actions/cache@v5.0.1
        with:
          path: ${{ runner.tool_cache }}/cargo-vet
          key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}

      - name: Add the tool cache directory to the search path
        run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH

      - name: Ensure that the tool cache is populated with the cargo-vet binary
        run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet

      - name: Invoke cargo-vet
        run: cargo vet --locked

  cargo-deny:
    name: Cargo Deny
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6

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

      - name: Install cargo-deny
        uses: taiki-e/install-action@cargo-deny

      - name: Run cargo deny
        run: cargo deny check