Backend: - migration 003: apply pixel→grid transform per-element (CASE WHEN > 50) instead of per-row, preventing double-conversion of mixed-scale rooms; skip empty arrays via json_array_length guard to avoid NULL assignment - attendance.rs: log layout JSON parse errors instead of silently swallowing them with .ok() - tutors.rs: check rows_affected() in set_tutor_active and return 404 for non-existent IDs; remap FK constraint errors on delete to 409 so concurrent inserts between conflict-check and DELETE don't surface as 500 Frontend: - live/[slotId]: expose polling failures to the tutor via error banner instead of only console.error - s/[code]: split checkin into two try/catch blocks so a successful POST followed by a failed reload doesn't report failure to the student; fix dead '409' string detection to match actual server error 'seat taken' - rooms/[roomId]: remove duplicate onMount fetch; add .catch() to $effect - tutors: expose loadTutors failures via error banner, not just console - rooms: fix bare catch in createRoom (captures error, shows message); add try/catch to onMount rooms load CI: - sync cargo audit --ignore RUSTSEC-2023-0071 with Makefile; the advisory is in rsa which sqlx-mysql retains in the lock file even when the mysql feature is disabled — aws_lc_rs correctly removes it from the active tree
114 lines
2.8 KiB
YAML
114 lines
2.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- main
|
|
tags-ignore:
|
|
- '**'
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: '9'
|
|
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: '1.95.0'
|
|
components: clippy, rustfmt
|
|
|
|
- name: Cache Cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
backend/target
|
|
key: cargo-${{ hashFiles('backend/Cargo.lock') }}
|
|
restore-keys: cargo-
|
|
|
|
- name: Cache pnpm store
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.local/share/pnpm/store
|
|
key: pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }}
|
|
restore-keys: pnpm-
|
|
|
|
- name: Install frontend deps
|
|
run: pnpm --dir frontend install --frozen-lockfile
|
|
|
|
- name: JS security audit
|
|
run: pnpm --dir frontend audit --audit-level high
|
|
|
|
- name: Generate SvelteKit types
|
|
run: pnpm --dir frontend exec svelte-kit sync
|
|
|
|
- name: Install Playwright browsers
|
|
run: pnpm --dir frontend exec playwright install --with-deps chromium
|
|
|
|
- name: Type check (backend)
|
|
run: cargo check --manifest-path backend/Cargo.toml
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --manifest-path backend/Cargo.toml -- -D warnings
|
|
|
|
- name: Format check
|
|
run: cargo fmt --manifest-path backend/Cargo.toml -- --check
|
|
|
|
- name: Type check (frontend)
|
|
run: pnpm --dir frontend exec tsgo --version && pnpm --dir frontend check
|
|
|
|
- name: Lint (frontend)
|
|
run: pnpm --dir frontend lint
|
|
|
|
- name: Unit tests (backend)
|
|
run: cargo test --manifest-path backend/Cargo.toml
|
|
|
|
- name: Security audit
|
|
run: |
|
|
cargo install cargo-audit --locked
|
|
cd backend && cargo audit --ignore RUSTSEC-2023-0071
|
|
|
|
- name: Build frontend
|
|
run: pnpm --dir frontend build
|
|
|
|
- name: E2E tests
|
|
env:
|
|
TT_TEST_PORT_RANDOM: '1'
|
|
run: |
|
|
make test-up
|
|
pnpm --dir frontend test:e2e
|
|
|
|
- name: Stop test backend
|
|
if: always()
|
|
run: make test-down || true
|
|
|
|
- name: Upload test results
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-results
|
|
path: |
|
|
frontend/test-results/
|
|
frontend/playwright-report/
|
|
retention-days: 7
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Docker build (no push)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: false
|
|
tags: tutortool:ci
|