Skip to content

fix: serve index.html for SPA client-side routes #501

fix: serve index.html for SPA client-side routes

fix: serve index.html for SPA client-side routes #501

Workflow file for this run

name: CI
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
backend-tests:
runs-on: ubuntu-latest
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
working-directory: platform
run: |
pip install -r requirements.txt
- name: Run tests with coverage
working-directory: platform
run: |
export FIELD_ENCRYPTION_KEY=$(python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())")
python -m pytest tests/ -v --tb=short --cov=. --cov-report=xml:coverage.xml
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v5
with:
files: platform/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
frontend-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: platform/frontend/package-lock.json
- name: Install dependencies
working-directory: platform/frontend
run: npm ci
- name: Lint
working-directory: platform/frontend
continue-on-error: true
run: npm run lint
- name: Build
working-directory: platform/frontend
run: npm run build
version-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: VERSION matches OpenAPI spec
run: |
FILE_VERSION=$(cat VERSION | tr -d '[:space:]')
SPEC_VERSION=$(grep -oP '"version"\s*:\s*"\K[^"]+' platform/main.py 2>/dev/null || echo "")
# main.py reads VERSION at runtime, so just verify VERSION is valid semver
if ! echo "$FILE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "::error::VERSION file contains invalid semver: '$FILE_VERSION'"
exit 1
fi
echo "VERSION: $FILE_VERSION"