cargo-regression 0.4.5

Collect test task from input files, execute them and compare results with golden.
Documentation
name: ci

# This should ensure that the workflow won't run on `dev-*` branches, but will
# otherwise execute on any other branch and any pull request (including PRs
# from dev branches).
on:
  push:
    branches: ["main"]
  pull_request:
    types: [opened, synchronize, reopened]
    branches:
      - '*'

env:
  CARGO_TERM_COLOR: always
  RUST_VERSION: "1.85.0"
  # A fixed version used for testing, so that the builds don't
  # spontaneously break after a few years.
  # Make sure to update this from time to time.
jobs:
  # Checks syntax formatting.
  fmt:
    name: Rustfmt
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: "-D warnings"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.RUST_VERSION }}
          components: rustfmt
      - run: cargo fmt --all -- --check

  # Run basic code validity check.
  check:
    needs: fmt
    name: Check
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: "-D warnings"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.RUST_VERSION }}
      - run: cargo check --all-features

  # Run tests.
  unit_test:
    needs: check
    name: Unit Test
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: "-D warnings"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.RUST_VERSION }}
          components: rustfmt
      - name: Build
        run: cargo install --path .
      - name: Run Tests
        run: cargo test --verbose
  # Checks code style.
  clippy:
    needs: check
    name: Clippy
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: "-D warnings -A clippy::todo"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.RUST_VERSION }}
          components: clippy
      - run: cargo clippy --all-features