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
27 changes: 11 additions & 16 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
name: Docs

on: [push, pull_request]
on:
push:
paths:
- 'docs/**'
- 'pyproject.toml'
- 'uv.lock'
pull_request:
paths:
- 'docs/**'
- 'pyproject.toml'
- 'uv.lock'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths: '["docs/**", "pyproject.toml", "uv.lock"]'

docs:
name: Checking docs build
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.3
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/check_migrations_sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,29 @@ jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
migrations: ${{ steps.filter.outputs.migrations }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
# paths-filter needs a checkout to diff push events
- uses: actions/checkout@v6.0.3
- id: filter
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
github_token: ${{ github.token }}
paths: '["morango/migrations/*.py", ".github/workflows/check_migrations_sqlite.yml", "pyproject.toml", "uv.lock"]'
filters: |
migrations:
- 'morango/migrations/*.py'
- '.github/workflows/check_migrations_sqlite.yml'
- 'pyproject.toml'
- 'uv.lock'

build:
name: Build wheel
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.migrations == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.3
Expand All @@ -46,13 +55,12 @@ jobs:
migration_test:
name: SQLite migration tests
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.migrations == 'true' }}
runs-on: ubuntu-latest
container:
image: python:3.7-buster
steps:
- name: Install build dependencies
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
echo "deb http://archive.debian.org/debian-archive/debian/ buster main" > /etc/apt/sources.list
echo "deb http://archive.debian.org/debian-archive/debian-security/ buster/updates main" >> /etc/apt/sources.list
Expand Down Expand Up @@ -96,5 +104,4 @@ jobs:
- name: Install dependencies
run: pip install "$(find dist -name '*.whl' | head -n 1)"
- name: Run migrations
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: python tests/testapp/manage.py migrate
21 changes: 15 additions & 6 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@ jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
lint: ${{ steps.filter.outputs.lint }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
# paths-filter needs a checkout to diff push events
- uses: actions/checkout@v6.0.3
- id: filter
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
github_token: ${{ github.token }}
paths_ignore: '["**.po", "**.json"]'
predicate-quantifier: every
# Not '!**.po': picomatch applies that negation at the repo root only.
filters: |
lint:
- '!**/*.po'
- '!**/*.json'

linting:
name: All file linting
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.lint == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.3
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,30 @@ jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
python: ${{ steps.filter.outputs.python }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
# paths-filter needs a checkout to diff push events
- uses: actions/checkout@v6.0.3
- id: filter
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
github_token: ${{ github.token }}
paths: '["**.py", ".github/workflows/tox.yml", "tox.ini", "pyproject.toml", "uv.lock"]'
filters: |
python:
- '**.py'
- '.github/workflows/tox.yml'
- 'tox.ini'
- 'pyproject.toml'
- 'uv.lock'

build:
name: Build wheel
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.3
Expand All @@ -46,7 +56,7 @@ jobs:
unit_test:
name: Python unit tests
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
strategy:
max-parallel: 5
Expand All @@ -73,7 +83,7 @@ jobs:
unit_test_eol_python:
name: Python unit tests for EOL Python versions
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
strategy:
max-parallel: 5
Expand Down Expand Up @@ -110,7 +120,7 @@ jobs:
cryptography:
name: Python unit tests + cryptography
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
env:
cryptography_version: '40.0.2'
Expand Down Expand Up @@ -142,7 +152,7 @@ jobs:
cryptography_eol_python:
name: Python unit tests + cryptography for EOL Python versions
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
env:
cryptography_version: '40.0.2'
Expand Down Expand Up @@ -188,7 +198,7 @@ jobs:
postgres:
name: Python postgres unit tests
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
services:
# Label used to access the service container
Expand Down Expand Up @@ -227,7 +237,7 @@ jobs:
windows:
name: Python unit tests on Windows Server
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: windows-latest
strategy:
max-parallel: 5
Expand Down
Loading