|
4 | 4 | branches: [main] |
5 | 5 | pull_request: |
6 | 6 |
|
7 | | -defaults: |
8 | | - run: |
9 | | - working-directory: django |
10 | | - |
11 | 7 | jobs: |
12 | 8 | all: |
13 | 9 | runs-on: ubuntu-latest |
14 | 10 | env: |
| 11 | + PYTHONPATH: ${{ github.workspace }}/django/ |
15 | 12 | DJANGO_SETTINGS_MODULE: config.settings.test |
| 13 | + TEST_PGUSER: postgres |
| 14 | + TEST_PGPASSWORD: postgres |
| 15 | + TEST_PGPORT: 5431 |
| 16 | + TEST_PGDATABASE: test_docurba |
16 | 17 | 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} |
19 | 19 | UPSTREAM_NUXT: http://localhost:3000 |
20 | 20 |
|
21 | 21 | steps: |
22 | | - - uses: actions/checkout@v4 |
| 22 | + - uses: actions/checkout@v4 # TODO use sha |
23 | 23 |
|
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 |
32 | 25 | with: |
33 | 26 | python-version-file: django/.python-version |
34 | | - - uses: astral-sh/setup-uv@v6 |
| 27 | + |
| 28 | + - uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 |
35 | 29 | with: |
36 | 30 | 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