-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (46 loc) · 1.58 KB
/
test-suite.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: Test Suite
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
pull-requests: write
env:
DJANGO_SETTINGS_MODULE: "project.settings.test"
jobs:
tests:
name: "Code quality and tests checks"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- name: Set up uv
# Install a specific uv version using the installer
run: "curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh"
env:
UV_VERSION: "0.4.4"
- name: Set up Python
run: uv python install
- name: "Install dependencies via uv"
run: uv sync --all-extras
- name: "Run linting checks: Ruff checker"
run: uv run ruff format --check --quiet src/
- name: "Run linting checks: Ruff linter"
run: uv run ruff check --quiet src/
- name: "Run linting checks: Mypy"
run: uv run mypy src/
- name: "Check that Django DB migrations are up to date"
run: uv run python manage.py makemigrations | grep "No changes detected"
- name: "Run tests"
# TODO: progressively increase minimum coverage to something closer to 80%
run: uv run pytest --cov=src --cov-report xml:coverage.xml
# --cov-fail-under=60 --> we'll actually do that with the "Report coverage" step
- name: "Report coverage"
# @link https://github.com/orgoro/coverage
uses: "orgoro/coverage@v3.1"
continue-on-error: true
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
thresholdAll: 0.6