CI: merge test + build into single job to avoid double npm ci
CI/CD / test-and-build (push) Successful in 2m46s Details
CI/CD / deploy (push) Has been skipped Details

Running npm ci twice in separate containers causes OOM on the shared
host. Single job: npm ci once, then tsc, vitest, and vite build
in sequence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-01 00:20:41 -07:00
parent bfab3ce043
commit b5b95ae5e1
1 changed files with 3 additions and 16 deletions

View File

@ -12,7 +12,7 @@ env:
IMAGE: gitea.jeffemmett.com/jeffemmett/canvas-website IMAGE: gitea.jeffemmett.com/jeffemmett/canvas-website
jobs: jobs:
test: test-and-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@ -34,27 +34,14 @@ jobs:
- name: Worker tests - name: Worker tests
run: npx vitest run --config vitest.worker.config.ts || echo "::warning::Worker tests had failures" run: npx vitest run --config vitest.worker.config.ts || echo "::warning::Worker tests had failures"
build-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
run: |
apt-get update -qq && apt-get install -y -qq git > /dev/null 2>&1
git clone --depth 1 --branch ${{ github.ref_name }} http://token:${{ github.token }}@server:3000/${{ github.repository }}.git .
- name: Install dependencies
run: npm ci --legacy-peer-deps --ignore-scripts
env:
NODE_OPTIONS: "--max-old-space-size=4096"
- name: Build - name: Build
run: npx tsc && npx vite build run: npx vite build
env: env:
NODE_OPTIONS: "--max-old-space-size=4096" NODE_OPTIONS: "--max-old-space-size=4096"
deploy: deploy:
if: github.ref == 'refs/heads/main' && github.event_name == 'push' if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: [test, build-check] needs: [test-and-build]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker:24-cli image: docker:24-cli