ci: add test+typecheck gate before deploy

Sebelumnya CI hanya build nix -> deploy tanpa verifikasi — placeholder
tests sempat rusak berbulan-bulan tanpa terdeteksi. Job 'test' baru:
- pnpm install + tsc --noEmit + vitest run untuk backend & discord-gateway
- biome check (errors fail, warnings pass)
- build-and-deploy now needs: test
This commit is contained in:
asepharyana
2026-08-01 22:10:28 +07:00
parent 6293d588bc
commit b3a2f2ec10
+43
View File
@@ -17,7 +17,50 @@ env:
VPS_USER: ${{ secrets.VPS_USER }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install pnpm
run: corepack enable && corepack prepare pnpm@11 --activate
- name: Install deps (backend)
working-directory: services/backend
run: pnpm install --ignore-scripts --no-frozen-lockfile
- name: Typecheck + test (backend)
working-directory: services/backend
run: |
./node_modules/.bin/tsc --noEmit
./node_modules/.bin/vitest run
- name: Install deps (discord-gateway)
working-directory: services/discord-gateway
run: pnpm install --ignore-scripts --no-frozen-lockfile
- name: Typecheck + test (discord-gateway)
working-directory: services/discord-gateway
run: |
./node_modules/.bin/tsc --noEmit
./node_modules/.bin/vitest run
- name: Biome check (all services)
run: |
cd services/backend && ./node_modules/.bin/biome check src/ tests/
cd ../discord-gateway && ./node_modules/.bin/biome check src/
build-and-deploy:
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false