👷 use migration files as cache key for database cache #5111
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: FragDenStaat CI | |
| on: push | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - uses: j178/prek-action@v1 | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.12', '3.13', '3.14'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Start services | |
| run: docker compose -f compose-dev.yaml up --wait | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v8.1.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| activate-environment: true | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install system-level dependencies | |
| run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt1-dev python3-dev libgdal-dev gdal-bin libmagic-dev libmagickwand-dev gettext libpoppler-cpp-dev | |
| - name: Install dependencies | |
| run: | | |
| uv sync --locked | |
| playwright install --with-deps chromium | |
| pnpm install | |
| - name: Build frontend | |
| run: pnpm run build | |
| - name: Compile translations | |
| run: | | |
| python manage.py compilemessages -i node_modules -l de | |
| - name: Restore database cache | |
| uses: actions/cache/restore@v5 | |
| id: db_cache | |
| with: | |
| path: dump.gz | |
| key: ${{ runner.os }}-${{ hashFiles('compose-dev.yaml') }} | |
| - name: Restore database | |
| if: steps.db_cache.outputs.cache-hit == 'true' | |
| run: ./scripts/restore_cached_db.sh | |
| - name: Run tests | |
| run: | | |
| pytest -n auto --cov --cov-report= fragdenstaat_de/ | |
| coverage report --format=markdown >> $GITHUB_STEP_SUMMARY |