-
Notifications
You must be signed in to change notification settings - Fork 6
116 lines (101 loc) Β· 3.43 KB
/
django.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Backend
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Debug enabled (~/.ssh/id_rsa)'
required: false
default: false
push:
branches: ['develop']
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- closed
jobs:
run-prod-bare:
if: github.repository == 'maxplanck-ie/parkour2'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and see that DEBUG is respected
run: |
make prod-ci
install-per-wiki-instructions:
if: github.repository == 'maxplanck-ie/parkour2'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Follow instructions
run: |
make
make create-admin
build-and-test:
env:
UV_SYSTEM_PYTHON: 1
if: github.repository == 'maxplanck-ie/parkour2'
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.10', 3.11, 3.12, 3.13]
services:
postgres:
env:
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
image: postgres:latest
ports:
- 5432/tcp
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup debug session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
timeout-minutes: 5
with:
detached: true
limit-access-to-actor: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up UV for py ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "backend/requirements/${{ matrix.python-version }}/*.txt"
- name: Install dependencies
run: |
uv pip install setuptools wheel ## ModuleNotFoundError Py312 lacks pkg_resources
uv pip install -r backend/requirements/${{ matrix.python-version }}/base.txt
- name: Verify migrations
env:
DJANGO_SETTINGS_MODULE: wui.settings.prod
DATABASE_URL: postgres://postgres:${{ secrets.POSTGRES_PASSWORD }}@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
python backend/manage.py makemigrations --no-input --check --dry-run
- name: Validate templates
env:
DJANGO_SETTINGS_MODULE: wui.settings.prod
DATABASE_URL: postgres://postgres:${{ secrets.POSTGRES_PASSWORD }}@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
python backend/manage.py validate_templates
- name: Run unittests
env:
DJANGO_SETTINGS_MODULE: wui.settings.testing
DATABASE_URL: postgres://postgres:${{ secrets.POSTGRES_PASSWORD }}@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
uv pip install -r backend/requirements/${{ matrix.python-version }}/testing.txt
python backend/manage.py test backend --parallel