From b3a2f2ec10a147e29caeb8463072232c2dfacb02 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Sat, 1 Aug 2026 22:10:28 +0700 Subject: [PATCH] ci: add test+typecheck gate before deploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/deploy.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d6d1bc5..a159dcd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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