feat(seo): add lastmod to static sitemap listing pages (#1324) #87
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: Tests | |
| # Runs the Django test suite on every push to master (our test-server deploy | |
| # trigger) and on every pull request. A failing run is a red ✗ + email — it | |
| # reports status only and does not block the push or the deploy. | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| # Postgres service mirrors the local-dev / server `db` container | |
| # (postgres:16, makeability / admin / password). | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_DB: makeability | |
| POSTGRES_USER: admin | |
| POSTGRES_PASSWORD: password | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U admin -d makeability" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| # settings_test.py reads these to reach the Postgres service above. | |
| DATABASE_HOST: localhost | |
| DATABASE_PORT: 5432 | |
| DJANGO_ENV: DEBUG | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Mirror the Dockerfile's system deps: ImageMagick + Ghostscript power the | |
| # PDF→thumbnail path that Artifact.save() runs (exercised by the Talk | |
| # fixtures); libpq-dev is needed to build psycopg2 from source. | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends imagemagick ghostscript libpq-dev | |
| sudo cp imagemagick-policy.xml /etc/ImageMagick-6/policy.xml | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| cache: pip | |
| - name: Install Python dependencies | |
| run: pip install -r requirements.txt | |
| # coverage.py is a test-only tool (lives in requirements-dev.txt) — install | |
| # it directly here rather than pulling all of requirements-dev.txt, which | |
| # would drag in Playwright. Keep this pin in sync with requirements-dev.txt. | |
| - name: Install coverage | |
| run: pip install coverage==7.14.1 | |
| # `coverage run` wraps the same test command and propagates its exit code, | |
| # so a test failure still fails this step (red ✗ + email). Config is in | |
| # .coveragerc (measures the `website` app, branch coverage on). | |
| - name: Run tests with coverage | |
| run: coverage run manage.py test website --settings=makeabilitylab.settings_test --verbosity=2 | |
| # Report-only: no --fail-under gate. Print to the log and also publish a | |
| # table to the run's Summary so the number is visible without opening logs. | |
| # Skipped automatically if the test step above failed. | |
| - name: Coverage report | |
| run: | | |
| coverage report | |
| { | |
| echo "## Coverage — website app" | |
| echo | |
| coverage report --format=markdown | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| # Browser end-to-end tests (member-page "Load more"/"Load all", bio toggle, | |
| # section nav). Kept in a SEPARATE job from `test` so the fast unit/integration | |
| # signal stays fast and isolated — a slow or flaky browser run doesn't muddy | |
| # "did the logic break?". Like `test`, this is report-only (it doesn't block | |
| # the push or the deploy). Playwright + its browser live in requirements-dev.txt | |
| # only, never in the production image. | |
| e2e: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_DB: makeability | |
| POSTGRES_USER: admin | |
| POSTGRES_PASSWORD: password | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U admin -d makeability" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_HOST: localhost | |
| DATABASE_PORT: 5432 | |
| DJANGO_ENV: DEBUG | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Same ImageMagick/Ghostscript deps as `test` — the Talk fixtures the e2e | |
| # tests create run Artifact.save()'s PDF->thumbnail path. | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends imagemagick ghostscript libpq-dev | |
| sudo cp imagemagick-policy.xml /etc/ImageMagick-6/policy.xml | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| cache: pip | |
| - name: Install Python dependencies (incl. Playwright) | |
| run: pip install -r requirements-dev.txt | |
| # Cache the downloaded browser keyed on the pinned Playwright version, so | |
| # only the first run (or a version bump) pays the ~120 MB download. | |
| - name: Cache Playwright browser | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ hashFiles('requirements-dev.txt') }} | |
| - name: Install Chromium for Playwright | |
| run: python -m playwright install --with-deps chromium | |
| - name: Run end-to-end tests | |
| run: python manage.py test website.tests.test_member_e2e --settings=makeabilitylab.settings_test --verbosity=2 |