Skip to content

Commit 5b67955

Browse files
committed
Add RAM and threads options to init action
1 parent 7112cda commit 5b67955

File tree

14 files changed

+268
-34
lines changed

14 files changed

+268
-34
lines changed

.github/workflows/__extractor-ram-threads.yml

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/pr-checks.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,42 @@ jobs:
388388
# Deliberately don't use TEST_MODE here. This is specifically testing
389389
# the compatibility with the API.
390390
runner/dist/codeql-runner-linux upload --sarif-file src/testdata/empty-sarif.sarif --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
391+
392+
runner-extractor-ram-threads-options:
393+
name: Runner ubuntu extractor RAM and threads options
394+
needs: [check-js, check-node-modules]
395+
runs-on: ubuntu-latest
396+
397+
steps:
398+
- uses: actions/checkout@v2
399+
400+
- name: Build runner
401+
run: |
402+
cd runner
403+
npm install
404+
npm run build-runner
405+
406+
- name: Run init
407+
run: |
408+
runner/dist/codeql-runner-linux init --ram=230 --threads=1 --repository $GITHUB_REPOSITORY --languages java --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
409+
410+
- name: Assert Results
411+
shell: bash
412+
run: |
413+
. ./codeql-runner/codeql-env.sh
414+
if [ "${CODEQL_RAM}" != "230" ]; then
415+
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
416+
exit 1
417+
fi
418+
if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
419+
echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
420+
exit 1
421+
fi
422+
if [ "${CODEQL_THREADS}" != "1" ]; then
423+
echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
424+
exit 1
425+
fi
426+
if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
427+
echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
428+
exit 1
429+
fi

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [UNRELEASED]
44

5-
No user facing changes.
5+
- The `init` step of the Action now supports `ram` and `threads` inputs to limit resource use of CodeQL extractors. [#738](https://github.com/github/codeql-action/pull/738)
66

77
## 1.0.14 - 09 Sep 2021
88

init/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ inputs:
4141
source-root:
4242
description: Path of the root source code directory, relative to $GITHUB_WORKSPACE.
4343
required: false
44+
ram:
45+
description: Override the amount of memory in MB to be used by CodeQL extractors. By default, almost all the memory of the machine is used.
46+
required: false
47+
threads:
48+
description: The number of threads to be used by CodeQL extractors.
49+
required: false
4450
outputs:
4551
codeql-path:
4652
description: The path of the CodeQL binary used for analysis

lib/init-action.js

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/runner.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)