CI: merge test + build into single job to avoid double npm ci
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:
parent
bfab3ce043
commit
b5b95ae5e1
|
|
@ -12,7 +12,7 @@ env:
|
|||
IMAGE: gitea.jeffemmett.com/jeffemmett/canvas-website
|
||||
|
||||
jobs:
|
||||
test:
|
||||
test-and-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -34,27 +34,14 @@ jobs:
|
|||
- name: Worker tests
|
||||
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
|
||||
run: npx tsc && npx vite build
|
||||
run: npx vite build
|
||||
env:
|
||||
NODE_OPTIONS: "--max-old-space-size=4096"
|
||||
|
||||
deploy:
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
needs: [test, build-check]
|
||||
needs: [test-and-build]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker:24-cli
|
||||
|
|
|
|||
Loading…
Reference in New Issue