From c425d3759dd2a6ded5f62a66bc5eb707cc1457ed Mon Sep 17 00:00:00 2001 From: Will Jones Date: Tue, 13 Feb 2024 17:33:09 -0800 Subject: [PATCH] ci: reduce number of build jobs on aarch64 to avoid OOM (#970) --- .github/workflows/npm-publish.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 1a393435..8f0b0efa 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -84,6 +84,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + # Buildjet aarch64 runners have only 1.5 GB RAM per core, vs 3.5 GB per core for + # x86_64 runners. Cargo defaults to spawn a job per core, but needs a lot + # of memory per job. Thus for ARM we need to reduce the number of jobs + # to avoid OOM errors when building. + - name: Configure aarch64 build + if: ${{ matrix.config.arch == 'aarch64' }} + run: echo "CARGO_BUILD_JOBS=4" >> "$GITHUB_ENV" - name: Build Linux Artifacts run: | bash ci/build_linux_artifacts.sh ${{ matrix.config.arch }}