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:
@@ -17,7 +17,50 @@ env:
|
|||||||
VPS_USER: ${{ secrets.VPS_USER }}
|
VPS_USER: ${{ secrets.VPS_USER }}
|
||||||
|
|
||||||
jobs:
|
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:
|
build-and-deploy:
|
||||||
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|||||||
Reference in New Issue
Block a user