diff --git a/.github/workflows/adev-preview-build.yml b/.github/workflows/adev-preview-build.yml index 89be429c8..daa1321f3 100644 --- a/.github/workflows/adev-preview-build.yml +++ b/.github/workflows/adev-preview-build.yml @@ -35,18 +35,18 @@ jobs: disk-cache: ${{ github.workflow }} repository-cache: true bazelrc: | - # Print all the options that apply to the build. - # This helps us diagnose which options override others - # (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc) - build --announce_rc - - # More details on failures - build --verbose_failures=true - - # CI supports colors but Bazel does not detect it. - common --color=yes + # Limit resources for CI runners (ubuntu-latest: 7GB RAM, 2 CPUs) + build --local_ram_resources=4096 + build --local_cpu_resources=2 + build --jobs=2 + build --discard_analysis_cache + build --nokeep_state_after_build - run: pnpm install --frozen-lockfile - - run: pnpm run build + - name: Build + run: pnpm run build + env: + _JAVA_OPTIONS: -Xms512m -Xmx2g + NODE_OPTIONS: --max-old-space-size=4096 - uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@0512a5b9381ccff00c278d7b4b6ee38e5c09654d with: workflow-artifact-name: 'adev-preview' diff --git a/.github/workflows/adev-production-deploy.yml b/.github/workflows/adev-production-deploy.yml index f0606fd7b..0323d4328 100644 --- a/.github/workflows/adev-production-deploy.yml +++ b/.github/workflows/adev-production-deploy.yml @@ -27,18 +27,18 @@ jobs: disk-cache: ${{ github.workflow }} repository-cache: true bazelrc: | - # Print all the options that apply to the build. - # This helps us diagnose which options override others - # (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc) - build --announce_rc - - # More details on failures - build --verbose_failures=true - - # CI supports colors but Bazel does not detect it. - common --color=yes + # Limit resources for CI runners (ubuntu-latest: 7GB RAM, 2 CPUs) + build --local_ram_resources=4096 + build --local_cpu_resources=2 + build --jobs=2 + build --discard_analysis_cache + build --nokeep_state_after_build - run: pnpm install --frozen-lockfile - - run: pnpm run build + - name: Build + run: pnpm run build + env: + _JAVA_OPTIONS: -Xms512m -Xmx2g + NODE_OPTIONS: --max-old-space-size=4096 - name: Deploy to Firebase Hosting uses: FirebaseExtended/action-hosting-deploy@0cbcac4740c2bfb00d632f0b863b57713124eb5a # v0.9.0 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78c661a4e..a77c7e5ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,8 +38,19 @@ jobs: bazelisk-cache: true disk-cache: ${{ github.workflow }} repository-cache: true + bazelrc: | + # Limit resources for CI runners (ubuntu-latest: 7GB RAM, 2 CPUs) + build --local_ram_resources=4096 + build --local_cpu_resources=2 + build --jobs=2 + build --discard_analysis_cache + build --nokeep_state_after_build - run: pnpm install - - run: pnpm run build + - name: Build + run: pnpm run build + env: + _JAVA_OPTIONS: -Xms512m -Xmx2g + NODE_OPTIONS: --max-old-space-size=4096 # build-windows: # runs-on: windows-latest # steps: diff --git a/tools/lib/adev.ts b/tools/lib/adev.ts index 78357c8fb..a443fe3fb 100644 --- a/tools/lib/adev.ts +++ b/tools/lib/adev.ts @@ -1,6 +1,7 @@ import { consola } from 'consola'; import { $ } from 'execa'; -import { buildDir } from './workspace'; +import { existsSync } from 'node:fs'; +import { buildDir, buildOutputDir } from './workspace'; const $$ = $({ stdin: 'inherit', @@ -13,6 +14,14 @@ export async function buildAdev() { const sh = $$({ cwd: buildDir }); await sh`pnpm install --frozen-lockfile`; await sh`pnpm bazel build //adev:build.production --config=release`; + + // Verify build output exists - Bazel may exit with code 0 even when interrupted + if (!existsSync(buildOutputDir)) { + throw new Error( + `Build output directory not found: ${buildOutputDir}\n` + + 'Bazel build may have been interrupted or failed silently.' + ); + } } export function serveAdev() {