Skip to content

💄 [#353] style: view labels instead of values for multiple d… #812

💄 [#353] style: view labels instead of values for multiple d…

💄 [#353] style: view labels instead of values for multiple d… #812

Workflow file for this run

name: Code quality checks
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- main
- stable/*
tags:
paths:
- "**.py"
- "**.json"
- "**.yaml"
- "**.yml"
- "**.in"
pull_request:
paths:
- "**.py"
- "**.json"
- "**.yaml"
- "**.yml"
- "**.in"
workflow_dispatch:
jobs:
migrations:
name: Check for model changes not present in migrations
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
services:
postgres:
image: postgres:17
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# Needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up backend environment
uses: maykinmedia/[email protected]
with:
apt-packages: "gettext postgresql-client"
python-version: "3.12"
setup-node: "no"
working-directory: backend
- name: Run makemigrations to check for missing migrations
working-directory: backend
run: |
src/manage.py makemigrations \
--check \
--dry-run
env:
DJANGO_SETTINGS_MODULE: "openbeheer.conf.ci"
DEBUG: "true"
SECRET_KEY: dummy
DB_USER: postgres
DB_NAME: postgres
DB_PASSWORD: ""
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
- name: Linting
run: ruff check
- name: Check formatting
run: ruff format --check
type-checking:
name: Type checking (Pyright)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "backend/requirements/type-checking.txt"
- name: Install required (stub-)packages
run: |
uv pip install \
--system \
-r requirements/type-checking.txt
working-directory: backend
- uses: jakebailey/pyright-action@v1
with:
version: 1.1.405
project: pyright-ci-pyproject.toml
backend-oas:
name: Check backend OAS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up backend environment
uses: maykinmedia/[email protected]
with:
apt-packages: "gettext"
python-version: "3.12"
setup-node: "no"
working-directory: backend
- name: Generate OAS
working-directory: backend
run: |
src/manage.py spectacular \
--validate \
--fail-on-warn \
--lang=en \
--file openbeheer-oas.yaml
env:
DJANGO_SETTINGS_MODULE: openbeheer.conf.ci
SECRET_KEY: dummy
- name: Check for OAS changes
run: |
git diff --exit-code openbeheer-oas.yaml
shell: bash
working-directory: backend
frontend-types:
name: Check frontend types
runs-on: ubuntu-latest
needs: backend-oas
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: "frontend/.nvmrc"
- name: Install frontend dependencies
run: npm ci
- name: Check types
run: npm run check-types