Skip to content

Commit 30db8ba

Browse files
committed
WIP CI
1 parent ac4106c commit 30db8ba

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

.github/workflows/lint_test.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,44 @@ on:
44
branches: [main]
55
pull_request:
66

7-
defaults:
8-
run:
9-
working-directory: django
10-
117
jobs:
128
all:
139
runs-on: ubuntu-latest
1410
env:
11+
PYTHONPATH: ${{ github.workspace }}/django/
1512
DJANGO_SETTINGS_MODULE: config.settings.test
13+
TEST_PGUSER: postgres
14+
TEST_PGPASSWORD: postgres
15+
TEST_PGPORT: 5431
16+
TEST_PGDATABASE: test_docurba
1617
SECRET_KEY: test_secret_key
17-
# Default supabase URL: https://supabase.com/docs/guides/local-development/cli/getting-started?queryGroups=access-method&access-method=postgres
18-
DATABASE_URL: postgresql://postgres:postgres@localhost:54322/postgres
18+
DATABASE_URL: postgres://${TEST_PGUSER}:${TEST_PGPASSWORD}@127.0.0.1:${TEST_PGPORT}/${TEST_PGDATABASE}
1919
UPSTREAM_NUXT: http://localhost:3000
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v4 # TODO use sha
2323

24-
- name: 🛠️ Installation de la CLI Supabase
25-
uses: supabase/setup-cli@b60b5899c73b63a2d2d651b1e90db8d4c9392f51
26-
with:
27-
version: 2.60.0
28-
29-
- run: supabase db start
30-
31-
- uses: actions/setup-python@v5
24+
- uses: actions/setup-python@v5 # TODO usa sha
3225
with:
3326
python-version-file: django/.python-version
34-
- uses: astral-sh/setup-uv@v6
27+
28+
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
3529
with:
3630
activate-environment: true
37-
- run: uv sync --locked --all-extras --dev --active
38-
- run: pytest --create-db
39-
- run: ruff format --diff .
40-
- run: ruff check --output-format=github .
41-
- run: python -m django makemigrations --check --dry-run --noinput || (echo "⚠ Migration manquante ⚠"; exit 1)
31+
32+
- run: uv sync --locked --all-extras --dev --active --project=django/
33+
34+
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
35+
with:
36+
version: 2025.11.4 # [default: latest] mise version to install
37+
install: true # [default: true] run `mise install`
38+
cache: true # [default: true] cache mise using GitHub's cache
39+
experimental: true # [default: false] enable experimental features
40+
41+
- name: 🛠️ Initialize the test database
42+
run: mise start:tests
43+
44+
- run: pytest django/tests/
45+
- run: ruff format --diff django/
46+
- run: ruff check --output-format=github django/
47+
- run: django-admin makemigrations --check --dry-run --noinput || (echo "⚠ Migration manquante ⚠"; exit 1)

0 commit comments

Comments
 (0)