Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/info-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Info site tests

# The standalone info pages in sites/meshview-info/ (served as /velkommen,
# /observer, /hardware, /radio, /guider, /faq) have their own browser tests.
# deploy.yml does not run them, so this workflow runs every
# sites/meshview-info/test-*.cjs|js on changes to the info site.
# Read-only: no secrets, no publish, no deploy.

on:
pull_request:
paths:
- 'sites/meshview-info/**'
- 'scripts/run-info-site-tests.sh'
- '.github/workflows/info-site.yml'
push:
branches: [master]
paths:
- 'sites/meshview-info/**'
- 'scripts/run-info-site-tests.sh'
- '.github/workflows/info-site.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: info-site-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
info-site:
name: "🌐 Info site tests"
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Node.js 22
uses: actions/setup-node@v5
with:
node-version: '22'
cache: npm

- name: Install dependencies
run: npm ci --production=false

- name: Install Chromium for Playwright
run: npx playwright install --with-deps chromium

- name: Run info site tests
run: bash scripts/run-info-site-tests.sh
16 changes: 16 additions & 0 deletions scripts/run-info-site-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Run every sites/meshview-info/test-*.cjs and test-*.js. Fails when any test
# fails, or when no test is found (a moved folder must not pass silently).
set -uo pipefail
cd "$(dirname "$0")/../sites/meshview-info" || { echo "sites/meshview-info not found" >&2; exit 1; }
shopt -s nullglob
tests=(test-*.cjs test-*.js)
if [ ${#tests[@]} -eq 0 ]; then echo "no info site tests found" >&2; exit 1; fi
failed=()
for t in "${tests[@]}"; do
echo "::group::$t"
if node "$t"; then echo "ok: $t"; else echo "FAIL: $t"; failed+=("$t"); fi
echo "::endgroup::"
done
echo "${#tests[@]} info site tests, ${#failed[@]} failed"
if [ ${#failed[@]} -gt 0 ]; then printf 'failed: %s\n' "${failed[@]}" >&2; exit 1; fi
Loading