mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 03:26:37 +08:00
77e3fdd1f6
After deploying the binary against a fresh data dir and exercising every
major REST endpoint by hand, codify the verification as a re-runnable
script.
scripts/smoke-test.sh:
- Spins up bin/mediastation-go against a tempdir.
- Generates 3 sample clips (movie, tv, anime) + an external SRT.
- Walks 26 assertions: health → auth → libraries → scan → ffprobe →
season parser → search → range stream → HLS playlist → external
subtitle → history → favourites → playlists → RBAC (alice 403) →
NFO export → recycle bin → SPA fallback → graceful shutdown.
- Tears the server down via SIGTERM and reports pass/fail counts.
- Exits non-zero on any failure so CI can use it as a deployment gate.
Local verification on this branch: PASS=26 FAIL=0.
Wiring:
- Makefile: new 'smoke' target, depends on 'build'.
- .github/workflows/ci.yml: third job 'smoke' that depends on backend
+ frontend, installs ffmpeg, builds both halves, then runs the
script. The CI pipeline now blocks merges that break end-to-end
deployability.
76 lines
1.6 KiB
YAML
76 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
backend:
|
|
name: Backend (Go)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
cache: true
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
- name: go build
|
|
run: go build ./...
|
|
|
|
- name: go test
|
|
run: go test ./...
|
|
|
|
frontend:
|
|
name: Frontend (Node)
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: web
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install
|
|
run: npm ci
|
|
|
|
- name: Type-check & build
|
|
run: npm run build
|
|
|
|
smoke:
|
|
name: E2E smoke test
|
|
runs-on: ubuntu-latest
|
|
needs: [backend, frontend]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
cache: true
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
- name: Install ffmpeg
|
|
run: sudo apt-get update && sudo apt-get install -y ffmpeg
|
|
- name: Build backend
|
|
run: make build-server
|
|
- name: Build frontend
|
|
run: cd web && npm ci && npm run build
|
|
- name: Run smoke test
|
|
run: ./scripts/smoke-test.sh
|
|
env:
|
|
PORT: 18080
|