Dev version bump #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "CI" | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
workflow_call: | |
workflow_dispatch: | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: "1" | |
PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
PYTHON_VERSION: "3.11" | |
jobs: | |
tests: | |
name: "Tests" | |
runs-on: "ubuntu-latest" | |
services: | |
db: | |
image: "postgres:15.1" | |
ports: | |
- "5432:5432" | |
env: | |
POSTGRES_HOST_AUTH_METHOD: "trust" | |
options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5" | |
steps: | |
- name: "Checkout code" | |
uses: "actions/checkout@v4" | |
- name: "Setup Python ${{ env.PYTHON_VERSION }}" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "${{ env.PYTHON_VERSION }}" | |
cache: "pip" | |
cache-dependency-path: "requirements/*.txt" | |
- name: "Install pip and wheel" | |
run: "python -m pip install --upgrade pip wheel -c requirements/constraints.txt" | |
- name: "Install Nox" | |
run: "python -m pip install nox -c requirements/constraints.txt" | |
- name: "Run tests (via Nox)" | |
run: "nox -s tests" | |
- name: "Upload coverage data" | |
uses: "actions/upload-artifact@v4" | |
with: | |
name: "coverage-data-${{ env.PYTHON_VERSION }}" | |
path: ".coverage.*" | |
include-hidden-files: true | |
coverage: | |
name: "Coverage report" | |
runs-on: "ubuntu-latest" | |
needs: "tests" | |
steps: | |
- name: "Checkout code" | |
uses: "actions/checkout@v4" | |
- name: "Setup Python ${{ env.PYTHON_VERSION }}" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "${{ env.PYTHON_VERSION }}" | |
cache: "pip" | |
cache-dependency-path: "requirements/*.txt" | |
- name: "Install pip and wheel" | |
run: "python -m pip install --upgrade pip wheel -c requirements/constraints.txt" | |
- name: "Install Nox" | |
run: "python -m pip install nox -c requirements/constraints.txt" | |
- uses: "actions/download-artifact@v4" | |
with: | |
pattern: "coverage-data-*" | |
merge-multiple: "true" | |
- name: "Combine coverage (via Nox)" | |
run: "nox -s coverage_report" | |
- name: "Upload coverage reports to Codecov" | |
uses: "codecov/codecov-action@v4" | |
with: | |
files: "coverage.xml" | |
env: | |
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" | |
checks: | |
name: "${{ matrix.name }}" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
include: | |
- name: "Code style checks" | |
nox_session: "code_style_checks" | |
- name: "Type checks" | |
nox_session: "type_checks" | |
- name: "Django checks" | |
nox_session: "django_checks" | |
steps: | |
- name: "Checkout code" | |
uses: "actions/checkout@v4" | |
- name: "Setup Python ${{ env.PYTHON_VERSION }}" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "${{ env.PYTHON_VERSION }}" | |
cache: "pip" | |
cache-dependency-path: "requirements/*.txt" | |
- name: "Install pip and wheel" | |
run: "python -m pip install --upgrade pip wheel -c requirements/constraints.txt" | |
- name: "Install Nox" | |
run: "python -m pip install nox -c requirements/constraints.txt" | |
- name: "Run '${{ matrix.nox_session }}' Nox session" | |
run: "nox -s ${{ matrix.nox_session }}" |