Skip to content

Split autofixes into its own workflow #73

Split autofixes into its own workflow

Split autofixes into its own workflow #73

name: Backend PR validation
on:
push:
branches:
- main
paths:
- "canopeum_backend/**"
- ".github/workflows/canopeum_backend_pr_validation.yml"
pull_request:
branches:
- main
- production
paths:
- "canopeum_backend/**"
- ".github/workflows/canopeum_backend_pr_validation.yml"
env:
# Since the Django mypy extention RUNS the config file, we need a non-empty secret to avoid
# ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
SECRET_KEY_DJANGO_CANOPEUM: mypy-ext
jobs:
django-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: canopeum_backend
steps:
- uses: actions/checkout@v4
- name: Install uv using the standalone installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync --locked --extra dev
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Run Django Tests
run: python manage.py test
mypy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: canopeum_backend
steps:
- uses: actions/checkout@v4
- name: Install uv using the standalone installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync --locked --extra dev
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- run: mypy . --python-version=3.12
pyright:
runs-on: ubuntu-latest
defaults:
run:
working-directory: canopeum_backend
steps:
- uses: actions/checkout@v4
- name: Install uv using the standalone installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync --locked --extra dev
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v2
with:
version: PATH
python-version: "3.12"
working-directory: canopeum_backend
Ruff:
runs-on: unbuntu-latest
defaults:
run:
working-directory: canopeum_backend
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
- uses: astral-sh/ruff-action@v1
# Format even on lint failure
if: ${{ !cancelled() }}
with:
args: format --check