Skip to content

Fix simulation failing for every preset; add tests, CI and deployment #4

Fix simulation failing for every preset; add tests, CI and deployment

Fix simulation failing for every preset; add tests, CI and deployment #4

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
# Hard ceiling so a non-converging solver can never hang a runner.
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
# Also builds physics-engine via its `prepare` hook, which backend and
# frontend need — they resolve @ignis/physics-engine through dist/.
- name: Install
run: npm ci
timeout-minutes: 5
- name: Typecheck
run: npm run typecheck
timeout-minutes: 3
- name: Lint
run: npm run lint
timeout-minutes: 3
- name: Test
run: npm test --workspace=@ignis/physics-engine
timeout-minutes: 5
# The physics accuracy suite: closed-form references for gravity,
# Tsiolkovsky delta-V, and trajectory plausibility.
- name: Physics validation suite
run: npm run validate:physics
timeout-minutes: 5
- name: Build
run: npm run build
timeout-minutes: 5
# Proves the single-service deployment path still builds and boots. Without
# this the Dockerfile silently rots — nothing else exercises it.
docker:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Build image
run: docker build -t ignis:ci .
- name: Boot and smoke-test
run: |
docker run -d --name ignis-ci -p 4000:4000 ignis:ci
for i in $(seq 1 30); do
if curl -fsS -m 5 http://localhost:4000/api/health >/dev/null 2>&1; then break; fi
sleep 2
done
echo "--- health ---"
curl -fsS -m 10 http://localhost:4000/api/health
echo "--- SPA is served ---"
curl -fsS -m 10 http://localhost:4000/ | grep -q '<div id="root">'
echo "--- a real launch returns 200 ---"
curl -fsS -m 60 -X POST http://localhost:4000/api/simulate/preset/vikram-1 >/dev/null
echo "smoke test passed"
- name: Container logs on failure
if: failure()
run: docker logs ignis-ci || true
- name: Clean up
if: always()
run: docker rm -f ignis-ci || true
# Formatting is not yet a blocking gate: the codebase predates .prettierrc
# and 66 files would need reformatting in one commit. Reported, not enforced,
# until the team decides to take that churn.
format:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- run: npm ci --ignore-scripts
# Reported, never enforced: the codebase predates .prettierrc and 66
# files would need reformatting in one commit. `|| true` keeps this
# informational — continue-on-error still renders the job as failed,
# which reads as a broken build.
- name: Formatting report (non-blocking)
run: npm run format:check || true