Django : la base de tests inclut le schéma de production #1122
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint & Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| all: | |
| runs-on: ubuntu-latest | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/django/ | |
| DJANGO_SETTINGS_MODULE: config.settings.test | |
| TEST_PGUSER: postgres | |
| TEST_PGPASSWORD: postgres | |
| TEST_PGHOST: 127.0.0.1 | |
| TEST_PGPORT: 5431 | |
| TEST_PGDATABASE: test_docurba | |
| SECRET_KEY: test_secret_key | |
| UPSTREAM_NUXT: http://localhost:3000 | |
| steps: | |
| - name: Set DATABASE_URL | |
| run: | | |
| echo "TEST_DATABASE_URL=postgres://${TEST_PGUSER}:${TEST_PGPASSWORD}@${TEST_PGHOST}:${TEST_PGPORT}/${TEST_PGDATABASE}" >> $GITHUB_ENV | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version-file: django/.python-version | |
| - uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 | |
| with: | |
| activate-environment: true | |
| - run: uv sync --locked --all-extras --dev --active --project=django/ | |
| - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 | |
| with: | |
| version: 2025.11.4 # [default: latest] mise version to install | |
| install: true # [default: true] run `mise install` | |
| cache: true # [default: true] cache mise using GitHub's cache | |
| experimental: true # [default: false] enable experimental features | |
| - name: 🛠️ Initialize the test database | |
| run: mise start:tests | |
| - run: django-admin collectstatic | |
| - run: pytest --cov django/tests/ django/tests/ | |
| - run: ruff format --diff django/ | |
| - run: ruff check --output-format=github django/ | |
| - run: django-admin makemigrations --check --dry-run --noinput || (echo "⚠ Migration manquante ⚠"; exit 1) |