Skip to content

ci: fix typo in group to sync for test #10

ci: fix typo in group to sync for test

ci: fix typo in group to sync for test #10

Workflow file for this run

name: CI
on:
workflow_call:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
CI: "1"
jobs:
changes:
name: Check for file changes
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
permissions:
pull-requests: read
contents: read
outputs:
deps: ${{steps.filter.outputs.deps}}
ci: ${{steps.filter.outputs.ci}}
python: ${{steps.filter.outputs.python}}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
deps: &deps-files
- 'pyproject.toml'
- 'uv.lock'
ci: &ci-files
- '.github/workflows/ci.yaml'
python:
- *deps-files
- *ci-files
- '**/*.py'
check_pre_commit:
name: Check pre-commit
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
permissions:
contents: read
checks: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ env.PYTHON_VERSION }}
- name: Load cached pre-commit environment
uses: actions/cache/restore@v4
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Install deps
run: uv sync --all-groups
- name: Run pre-commit hook
id: run-pre-commit-hooks
run: |
git add .pre-commit-config.yaml
uv run pre-commit run --color=always --all-files
- name: Annotate any changes using reviewdog
if: ${{ failure() }}
id: reviewdog-suggester
uses: reviewdog/action-suggester@v1
with:
tool_name: pre-commit
- name: Save pre-commit cache
if: ${{ always() }}
uses: actions/cache/save@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
test:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
needs: [changes]
if: ${{needs.changes.outputs.python == 'true' && !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install deps
run: uv sync --group test
- name: Run tests
uses: quantco/pytest-action@v2
with:
verbose: true
job-summary: true
emoji: true
custom-pytest: uv run pytest -n 2
click-to-expand: true
report-title: "Test Report"