From 514252efcb66b08e1768b2744683d623787e2e8c Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Thu, 16 Jan 2025 11:42:55 +0000 Subject: [PATCH] Add pre-commit test --- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ .pre-commit-config.yaml | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 558b05b..6ec124d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,6 +48,31 @@ jobs: run: | uv run --frozen mypy --install-types --non-interactive + pre-commit: + runs-on: macos-15 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v5 + + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Install artisatomic and run pre-commit + run: | + uv sync --frozen + source .venv/bin/activate + uv pip install --editable .[dev] + uv run --frozen -- pre-commit run --all-files --show-diff-on-failure --color=always pytest: runs-on: macos-15 steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 162fe09..0ee5ebd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: hooks: - id: yamlfmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.3 + rev: v0.9.1 hooks: - id: ruff args: [--fix]