positive 0.6.1

A type-safe wrapper for guaranteed positive decimal values
Documentation
name: Quality Gate

on:
  push:
    branches:
      - '**'
  pull_request:
    branches:
      - main
      - 'release/**'

permissions:
  contents: read

concurrency:
  group: quality-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  quality:
    name: make check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        # actions/checkout v7.0.1
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

      - name: Install Rust
        # dtolnay/rust-toolchain master (the generic action; the version branches
        # such as `1.14` hardcode that Rust release and reject a `toolchain` input)
        uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772
        id: toolchain
        with:
          toolchain: stable
          components: rustfmt, clippy

      - name: Cache Rust dependencies
        # actions/cache v6.1.0
        uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            target/
          key: ${{ runner.os }}-quality-${{ steps.toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}
          restore-keys: |
            ${{ runner.os }}-quality-${{ steps.toolchain.outputs.cachekey }}-

      - name: Install make
        run: sudo apt-get update && sudo apt-get install -y make

      # This is the whole gate. It is the same single command a contributor
      # runs locally, so CI and local development cannot diverge: the matrix,
      # the strict lints, the banned-pattern scan, the README check and the
      # audit are all defined once, in the Makefile.
      - name: Run the quality gate
        run: make check

      # `make check` must be read-only. If any target mutated a tracked file,
      # the gate would be able to "pass" by editing the worktree instead of
      # reporting — which is exactly what `make fmt` in the format job and
      # `cargo fix` in pre-push used to do.
      - name: Assert the gate changed nothing
        run: |
          if ! git diff --quiet; then
            echo "The quality gate modified tracked files:"
            git --no-pager diff --stat
            exit 1
          fi
          echo "OK: the gate is read-only"