Guard prototype route and stop hardcoding the API origin #25
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: Backend tests | |
| # Runs the Django test suite and, crucially, verifies migrations apply on a | |
| # fresh database. The latter catches deploy-only regressions that unit tests | |
| # miss — e.g. an app whose migrations package lacks __init__.py, so `migrate` | |
| # silently never creates its tables. | |
| on: | |
| push: | |
| branches: [v1, main] | |
| paths: | |
| - "heritage_graph/**" | |
| - "requirements.txt" | |
| - ".github/workflows/backend-tests.yml" | |
| pull_request: | |
| paths: | |
| - "heritage_graph/**" | |
| - "requirements.txt" | |
| - ".github/workflows/backend-tests.yml" | |
| jobs: | |
| backend: | |
| runs-on: ubuntu-latest | |
| env: | |
| DJANGO_ENV: development | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Check for missing migrations | |
| working-directory: heritage_graph | |
| run: python manage.py makemigrations --check --dry-run | |
| - name: Apply migrations on a fresh database | |
| # Plain `migrate` (no --run-syncdb): an unmigrated app would NOT get its | |
| # tables here, reproducing production and failing loudly at runtime. | |
| working-directory: heritage_graph | |
| run: python manage.py migrate --noinput | |
| - name: Run test suite | |
| working-directory: heritage_graph | |
| run: python manage.py test --verbosity 1 |