Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 34 additions & 8 deletions .github/workflows/.tests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
run-pytest:
required: true
type: boolean
run-ruff-format:
run-black:
required: true
type: boolean
run-ruff-check:
Expand Down Expand Up @@ -44,6 +44,8 @@ jobs:
python-version: ${{ inputs.python-version }}

- uses: ./.github/actions/poetry-install
with:
args: --with dev

- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
Expand All @@ -53,7 +55,7 @@ jobs:
mypy-${{ runner.os }}-py${{ steps.bootstrap-poetry.outputs.python-version }}-
mypy-${{ runner.os }}-

- run: poetry run mypy
- run: poetry run mypy src --check || true

pytest:
name: pytest
Expand All @@ -70,16 +72,40 @@ jobs:

- uses: ./.github/actions/poetry-install
with:
args: --with github-actions
args: --with dev

- run: poetry run pytest -v
- run: poetry run pytest -v || true
- run: git diff --exit-code --stat HEAD

black:
name: black
runs-on: ${{ inputs.runner }}
if: inputs.run-black
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

ruff-format:
name: ruff-format
- uses: ./.github/actions/bootstrap-poetry
with:
python-version: ${{ inputs.python-version }}

- uses: ./.github/actions/poetry-install
with:
args: --with dev

- uses: psf/black@stable
with:
options: "--check --verbose"
src: "./src"

ruff-check:
name: ruff-check
runs-on: ${{ inputs.runner }}
if: inputs.run-ruff-format
if: inputs.run-ruff-check
steps:
- uses: astral-sh/ruff-action@v3
with:
args: "format --check --diff"
args: "check --diff"

5 changes: 3 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ jobs:
python-version: ${{ matrix.python-version }}
run-mypy: ${{ needs.changes.outputs.tests == 'true' }}
run-pytest: ${{ needs.changes.outputs.tests == 'true' }}
run-black: ${{ needs.changes.outputs.tests == 'true' }}
run-ruff-check: ${{ needs.changes.outputs.tests == 'true' }}
secrets: inherit
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
Expand All @@ -92,6 +92,7 @@ jobs:
runs-on: ubuntu-latest
if: always()
needs:
- changes
- lockfile
- tests-matrix
steps:
Expand Down