-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (67 loc) · 2.2 KB
/
code_test.yml
File metadata and controls
87 lines (67 loc) · 2.2 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}/${{ github.ref }}
cancel-in-progress: true
jobs:
fetch-python-versions:
runs-on: ubuntu-latest
outputs:
supported_versions: ${{ steps.fetch-versions.outputs.supported_versions }}
bound_versions: ${{ steps.fetch-versions.outputs.bound_versions }}
steps:
- name: Fetch Supported Python
id: fetch-versions
run: |
versions=$(curl -fsSL https://endoflife.date/api/v1/products/python/ \
| jq '[ .result.releases[] | select(.isEol == false) | .label ]')
echo "supported_versions=$(echo $versions | jq -c '.')" >> $GITHUB_OUTPUT
echo "bound_versions=$(echo $versions | jq -c '[.[0],.[-1]]')" >> $GITHUB_OUTPUT
test_backend:
needs: fetch-python-versions
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
matrix:
python-version: ${{ fromJson(needs.fetch-python-versions.outputs.supported_versions) }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group dev
- name: Unit tests
working-directory: backend
run: uv run coverage run -m pytest -svm unit
- name: Integration tests
working-directory: backend
run: uv run coverage run --append -m pytest -svm integration
- name: Generate coverage report
working-directory: backend
run: uv run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
use_oidc: true
verbose: true
test_migrations:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- name: Migration tests
run: |
uv run migrations/run_tests.py -n auto