From 97302ec9295545d2a15255dbe3ce20aa175a982a Mon Sep 17 00:00:00 2001 From: ppraneth Date: Wed, 7 Oct 2026 11:20:22 +0530 Subject: [PATCH] add CI running tests and pre-commit hooks on PRs --- .github/workflows/checks.yml | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/checks.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..13de266 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,54 @@ +name: Checks + +on: + pull_request: + workflow_dispatch: + schedule: + - cron: '41 16 * * 1' # Every Monday at 16:41 UTC, to catch breakage from new Rust releases. + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + +jobs: + tests: + name: Tests (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Run tests + run: cargo test --all-features + + code-quality: + name: Code quality (pre-commit hooks) + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Set up uv + uses: astral-sh/setup-uv@v10.2.0 + + # The tests job already runs cargo test, on every OS. + - name: Run pre-commit hooks + run: uvx pre-commit run --all-files --show-diff-on-failure + env: + SKIP: cargo-test