From 0a73c07f09f98c87715f45a859876f7e0cfd46da Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Thu, 9 Jul 2026 17:02:21 +0100 Subject: [PATCH] ci: split frontend into build gate then parallel typecheck/lint/audit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm run build runs first as the gate. On success, typecheck, lint, and npm audit fire in parallel — all restoring node_modules from the build job's cache. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- .gitea/workflows/ci.yaml | 52 ++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 0e0e3f4..1575e8f 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -225,8 +225,8 @@ jobs: go install golang.org/x/vuln/cmd/govulncheck@latest govulncheck ./... - frontend: - name: Frontend lint & types + frontend-build: + name: Frontend build (gate) runs-on: ubuntu-latest defaults: run: @@ -249,13 +249,45 @@ jobs: restore-keys: | ${{ runner.os }}-npm- - - name: Frontend type check - run: | - cd frontend - npm ci - npm run check + - name: Install dependencies + run: cd frontend && npm ci - - name: Frontend lint + - name: Build + run: cd frontend && npm run build + + frontend-qc: + name: Frontend ${{ matrix.script }} + needs: [frontend-build] + runs-on: ubuntu-latest + defaults: + run: + shell: sh + strategy: + matrix: + include: + - script: typecheck + cmd: npm run check + - script: lint + cmd: npm run lint + - script: audit + cmd: npm audit --audit-level=high + steps: + - uses: actions/checkout@v4 + + - name: Fix node toolcache path for Post-step cleanup run: | - cd frontend - npm run lint + mkdir -p /opt/hostedtoolcache/node/22.23.1/x64/bin + ln -sf /usr/local/bin/node /opt/hostedtoolcache/node/22.23.1/x64/bin/node + + - name: Restore npm dependencies + uses: actions/cache@v4 + with: + path: | + ~/.npm + frontend/node_modules + key: ${{ runner.os }}-npm-${{ hashFiles('frontend/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: ${{ matrix.script }} + run: cd frontend && ${{ matrix.cmd }}