Skip to content

Commit a57d20e

Browse files
authored
ci(codeql): cap Analyze (c-cpp) build+run-queries footprint on self-hosted 905 (#611)
CodeQL was auto-sizing run-queries to --ram=60466 --threads=32 (nearly the whole 905 box) and building with -j$(nproc). When it ran concurrently with an ASan job on the shared self-hosted runner both jobs co-OOMed (exit-137 / conclusion=null kill), leaving Analyze (c-cpp) as the lone red on DASH PRs while every other toolchain compiled the identical code green. Cap self-hosted only: build -j8, analyze threads=12 ram=20000MB, leaving headroom for a concurrent ASan job. github-hosted (fork) runs keep auto defaults (threads/ram=0, -j$(nproc)). Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
1 parent 4b23f9d commit a57d20e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,24 @@ jobs:
9595
cmake -S . -B build_codeql \
9696
-DCMAKE_TOOLCHAIN_FILE=build_codeql/conan_toolchain.cmake \
9797
-DCMAKE_BUILD_TYPE=Release
98-
cmake --build build_codeql --target c2pool -j$(nproc)
98+
# Cap build parallelism on the shared self-hosted 905 box so the
99+
# CodeQL build does not co-OOM with a concurrent ASan job.
100+
# github-hosted (fork) runs keep full parallelism.
101+
if [ "${{ runner.environment }}" = "github-hosted" ]; then
102+
JOBS=$(nproc)
103+
else
104+
JOBS=8
105+
fi
106+
cmake --build build_codeql --target c2pool -j"$JOBS"
99107
100108
# ── Analysis ──────────────────────────────────────────────────────────
101109
- name: Perform CodeQL Analysis
102110
uses: github/codeql-action/analyze@v4
103111
with:
104112
category: "/language:${{ matrix.language }}"
113+
# Cap the run-queries footprint on the shared self-hosted 905 box so
114+
# CodeQL does not co-OOM with a concurrent ASan job (was auto-sizing
115+
# to --ram=60466 --threads=32, nearly the whole box). 0 = action
116+
# auto-default, kept for github-hosted (fork) runs.
117+
threads: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && '12' || '0' }}
118+
ram: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && '20000' || '0' }}

0 commit comments

Comments
 (0)