GeezerVison is showing github.com — Add RAM and threads options to init action · github/codeql-action@5533fe9
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/__extractor-ram-threads.yml +63Lines changed: 63 additions & 0 deletions Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/pr-checks.yml +39Lines changed: 39 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -393,3 +393,42 @@ jobs: |
393 | 393 | # Deliberately don't use TEST_MODE here. This is specifically testing |
394 | 394 | # the compatibility with the API. |
395 | 395 | 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 |
Collapse file
Copy file name to clipboardExpand all lines: CHANGELOG.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
2 | 2 |
|
3 | 3 | ## [UNRELEASED] |
4 | 4 |
|
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) |
6 | 6 |
|
7 | 7 | ## 1.0.19 - 18 Oct 2021 |
8 | 8 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: analyze/action.yml +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,9 @@ inputs: |
18 | 18 | required: false |
19 | 19 | default: "brutal" |
20 | 20 | ram: |
21 | | - description: Override the amount of memory in MB to be used by CodeQL. By default, almost all the memory of the machine is used. |
| 21 | + description: >- |
| 22 | + The amount of memory in MB that can be used by CodeQL for database finalization and query execution. |
| 23 | + By default, this action will use the same amount of memory as previously set in the "init" action. |
22 | 24 | required: false |
23 | 25 | add-snippets: |
24 | 26 | description: Specify whether or not to add code snippets to the output sarif file. |
@@ -29,7 +31,9 @@ inputs: |
29 | 31 | required: false |
30 | 32 | default: "false" |
31 | 33 | threads: |
32 | | - description: The number of threads to be used by CodeQL. |
| 34 | + description: >- |
| 35 | + The number of threads that can be used by CodeQL for database finalization and query execution. |
| 36 | + By default, this action will use the same number of threads as previously set in the "init" action. |
33 | 37 | required: false |
34 | 38 | checkout_path: |
35 | 39 | description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file." |
|
Collapse file
Copy file name to clipboardExpand all lines: init/action.yml +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -41,6 +41,18 @@ inputs: |
41 | 41 | source-root: |
42 | 42 | description: Path of the root source code directory, relative to $GITHUB_WORKSPACE. |
43 | 43 | required: false |
| 44 | + ram: |
| 45 | + description: >- |
| 46 | + The amount of memory in MB that can be used by CodeQL extractors. |
| 47 | + By default, CodeQL extractors will use most of the memory available in the system. |
| 48 | + This input also sets the amount of memory that can later be used by the "analyze" action. |
| 49 | + required: false |
| 50 | + threads: |
| 51 | + description: >- |
| 52 | + The number of threads that can be used by CodeQL extractors. |
| 53 | + By default, CodeQL extractors will use all the hardware threads available in the system. |
| 54 | + This input also sets the number of threads that can later be used by the "analyze" action. |
| 55 | + required: false |
44 | 56 | outputs: |
45 | 57 | codeql-path: |
46 | 58 | description: The path of the CodeQL binary used for analysis |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/analyze-action-env.test.js +75Lines changed: 75 additions & 0 deletions Collapse file
Copy file name to clipboardExpand all lines: lib/analyze-action-env.test.js.map +1Lines changed: 1 addition & 0 deletions Collapse file
Copy file name to clipboardExpand all lines: lib/analyze-action-input.test.js +75Lines changed: 75 additions & 0 deletions Collapse file
Copy file name to clipboardExpand all lines: lib/analyze-action-input.test.js.map +1Lines changed: 1 addition & 0 deletions Collapse file
Copy file name to clipboardExpand all lines: lib/analyze-action.js +6-3Lines changed: 6 additions & 3 deletions