Skip to content

Commit 56c7489

Browse files
authored
Merge branch 'main' into aeisenberg/dependabot
2 parents 531c6ba + 3ba4184 commit 56c7489

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1020
-127
lines changed

Diff for: .github/workflows/__debug-artifacts.yml

+75
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .github/workflows/__extractor-ram-threads.yml

+63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .github/workflows/pr-checks.yml

+39
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

Diff for: .github/workflows/update-dependencies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
git config --global user.name "github-actions[bot]"
3838
git add node_modules
3939
git commit -am "Update checked-in dependencies"
40-
git push origin "$BRANCH"
40+
git push origin "HEAD:$BRANCH"
4141
fi

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## [UNRELEASED]
44

5+
- The `init` step of the Action now supports `ram` and `threads` inputs to limit resource use of CodeQL extractors. These inputs also serve as defaults to the subsequent `analyze` step, which finalizes the database and executes queries. [#738](https://github.com/github/codeql-action/pull/738)
6+
7+
## 1.0.21 - 28 Oct 2021
8+
9+
- Update default CodeQL bundle version to 2.7.0. [#795](https://github.com/github/codeql-action/pull/795)
10+
11+
## 1.0.20 - 25 Oct 2021
12+
513
No user facing changes.
614

715
## 1.0.19 - 18 Oct 2021

Diff for: analyze/action.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
name: 'CodeQL: Finish'
2-
description: 'Finalize CodeQL database'
3-
author: 'GitHub'
1+
name: "CodeQL: Finish"
2+
description: "Finalize CodeQL database"
3+
author: "GitHub"
44
inputs:
55
check_name:
66
description: The name of the check run to add text to.
77
required: false
88
output:
99
description: The path of the directory in which to save the SARIF results
1010
required: false
11-
default: '../results'
11+
default: "../results"
1212
upload:
13-
description: Upload the SARIF file
13+
description: Upload the SARIF file to Code Scanning
1414
required: false
1515
default: "true"
1616
cleanup-level:
1717
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
1818
required: false
1919
default: "brutal"
2020
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.
24+
If the "init" action also does not have an explicit "ram" input, this action will use most of the
25+
memory available in the system (which for GitHub-hosted runners is 6GB for Linux, 5.5GB for Windows,
26+
and 13GB for macOS).
2227
required: false
2328
add-snippets:
2429
description: Specify whether or not to add code snippets to the output sarif file.
@@ -29,7 +34,12 @@ inputs:
2934
required: false
3035
default: "false"
3136
threads:
32-
description: The number of threads to be used by CodeQL.
37+
description: >-
38+
The number of threads that can be used by CodeQL for database finalization and query execution.
39+
By default, this action will use the same number of threads as previously set in the "init" action.
40+
If the "init" action also does not have an explicit "threads" input, this action will use all the
41+
hardware threads available in the system (which for GitHub-hosted runners is 2 for Linux and Windows
42+
and 3 for macOS).
3343
required: false
3444
checkout_path:
3545
description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
@@ -50,5 +60,5 @@ outputs:
5060
db-locations:
5161
description: A map from language to absolute path for each database created by CodeQL.
5262
runs:
53-
using: 'node12'
54-
main: '../lib/analyze-action.js'
63+
using: "node12"
64+
main: "../lib/analyze-action.js"

Diff for: init/action.yml

+18
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ inputs:
4141
source-root:
4242
description: Path of the root source code directory, relative to $GITHUB_WORKSPACE.
4343
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+
(which for GitHub-hosted runners is 6GB for Linux, 5.5GB for Windows, and 13GB for macOS).
49+
This input also sets the amount of memory that can later be used by the "analyze" action.
50+
required: false
51+
threads:
52+
description: >-
53+
The number of threads that can be used by CodeQL extractors.
54+
By default, CodeQL extractors will use all the hardware threads available in the system
55+
(which for GitHub-hosted runners is 2 for Linux and Windows and 3 for macOS).
56+
This input also sets the number of threads that can later be used by the "analyze" action.
57+
required: false
58+
debug:
59+
description: Enable debugging mode. This will result in more output being produced which may be useful when debugging certain issues.
60+
required: false
61+
default: 'false'
4462
outputs:
4563
codeql-path:
4664
description: The path of the CodeQL binary used for analysis

Diff for: lib/analysis-paths.test.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/analysis-paths.test.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)