Resolve AB-620 review findings and clean Home links #254
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: Validate | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| repository-validation: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.10' | |
| - name: Set up Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| - name: Install Python quality tools | |
| run: python -m pip install ruff==0.15.2 | |
| - name: Install browser smoke dependencies | |
| run: | | |
| npm ci | |
| npx playwright install --with-deps chromium | |
| - name: Lint Python | |
| run: ruff check . | |
| - name: Compile Python tools | |
| run: python -m py_compile server.py tools/generate-exam-data-js.py tools/generate-exam-pages.py tools/inject-analytics-secret.py tools/validate-exam-packs.py | |
| - name: Check JavaScript syntax | |
| run: | | |
| node --check service-worker.js | |
| find assets/js -name '*.js' -print0 | xargs -0 -n1 node --check | |
| - name: Validate exam packs | |
| run: python tools/validate-exam-packs.py --root user-content/exams | |
| - name: Check pack manifests (SHA-256 integrity) | |
| run: python tools/validate-exam-packs.py --root user-content/exams --check-manifest | |
| - name: Run repository tests | |
| run: python -m unittest discover -s tests -v | |
| - name: Run browser smoke | |
| env: | |
| SMOKE_BASE_URL: http://127.0.0.1:4173 | |
| run: | | |
| python -m http.server 4173 --bind 127.0.0.1 >/tmp/examplar-http.log 2>&1 & | |
| server_pid=$! | |
| trap 'kill "$server_pid"' EXIT | |
| for attempt in $(seq 1 20); do | |
| if curl --fail --silent http://127.0.0.1:4173/index.html >/dev/null; then | |
| break | |
| fi | |
| sleep 0.25 | |
| done | |
| npm run test:browser |