Skip to content

Commit e5d6137

Browse files
committed
Add RAM and threads options to init action
1 parent ef3290c commit e5d6137

File tree

16 files changed

+317
-69
lines changed

16 files changed

+317
-69
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
@@ -393,3 +393,42 @@ jobs:
393393
# Deliberately don't use TEST_MODE here. This is specifically testing
394394
# the compatibility with the API.
395395
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 }}
396+
397+
runner-extractor-ram-threads-options:
398+
name: Runner ubuntu extractor RAM and threads options
399+
needs: [check-js, check-node-modules]
400+
runs-on: ubuntu-latest
401+
402+
steps:
403+
- uses: actions/checkout@v2
404+
405+
- name: Build runner
406+
run: |
407+
cd runner
408+
npm install
409+
npm run build-runner
410+
411+
- name: Run init
412+
run: |
413+
runner/dist/codeql-runner-linux init --ram=230 --threads=1 --repository $GITHUB_REPOSITORY --languages java --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
414+
415+
- name: Assert Results
416+
shell: bash
417+
run: |
418+
. ./codeql-runner/codeql-env.sh
419+
if [ "${CODEQL_RAM}" != "230" ]; then
420+
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
421+
exit 1
422+
fi
423+
if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
424+
echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
425+
exit 1
426+
fi
427+
if [ "${CODEQL_THREADS}" != "1" ]; then
428+
echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
429+
exit 1
430+
fi
431+
if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
432+
echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
433+
exit 1
434+
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.15 - 22 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)