41 lines
1021 B
YAML
41 lines
1021 B
YAML
name: CI
|
|
|
|
# Runs tests on every push (commit) to any branch, and on pull requests.
|
|
"on":
|
|
push:
|
|
branches: ['**']
|
|
pull_request:
|
|
branches: ['**']
|
|
|
|
jobs:
|
|
test-and-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
# 1) Static/type checks (svelte-check). Fast, no network.
|
|
- name: Type & Svelte checks
|
|
run: npm run check
|
|
|
|
# 2) Data-integrity + search regressions against committed data.
|
|
# Runs offline; does NOT hit the Overpass API (avoids rate limits).
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
# 3) Build the static site using committed static/data (no live fetch).
|
|
- name: Static build
|
|
run: npm run build:static
|
|
|
|
- name: Verify build output
|
|
run: |
|
|
test -f build/index.html
|
|
test -d build/data
|
|
echo "Build output OK" |