Skip to content

Commit 736f65d

Browse files
Merge branch 'main' into jhutchings1-patch-1
2 parents 762078e + 7d5b76a commit 736f65d

10 files changed

Lines changed: 34 additions & 20 deletions

File tree

.github/workflows/python-deps.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ jobs:
4343
- uses: actions/checkout@v2
4444

4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: ./init
4747
with:
48+
tools: latest
4849
languages: python
50+
setup-python-dependencies: false
4951

5052
- name: Test Auto Package Installation
5153
run: |
@@ -60,7 +62,8 @@ jobs:
6062
esac
6163
echo ${basePath}
6264
63-
find ${basePath}/hostedtoolcache/CodeQL -path "*x64/codeql" -exec $GITHUB_WORKSPACE/python-setup/auto_install_packages.py {} \;
65+
codeql_version="0.0.0-$(cat "$GITHUB_WORKSPACE/src/defaults.json" | jq -r .bundleVersion | rev | cut -d - -f 1 | rev)"
66+
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "${basePath}/hostedtoolcache/CodeQL/$codeql_version/x64/codeql"
6467
- name: Setup for extractor
6568
run: |
6669
echo $CODEQL_PYTHON
@@ -103,23 +106,28 @@ jobs:
103106
- uses: actions/checkout@v2
104107

105108
- name: Initialize CodeQL
106-
uses: github/codeql-action/init@v1
109+
uses: ./init
107110
with:
111+
tools: latest
108112
languages: python
113+
setup-python-dependencies: false
109114

110115
- name: Test Auto Package Installation
111116
run: |
112117
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
113118
powershell -File $cmd
114119
115120
cd $Env:GITHUB_WORKSPACE\\${{ matrix.test_dir }}
116-
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\0.0.0-20200826\\x64\\codeql
121+
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
122+
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
123+
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
124+
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
117125
- name: Setup for extractor
118126
run: |
119127
echo $Env:CODEQL_PYTHON
120128
121-
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
129+
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
122130
- name: Verify packages installed
123131
run: |
124132
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1"
125-
powershell -File $cmd ${{ matrix.python_version }}
133+
powershell -File $cmd ${{ matrix.python_version }}

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ on:
2323
pull_request:
2424
schedule:
2525
# ┌───────────── minute (0 - 59)
26-
# │ ┌───────────── hour (0 - 23)
27-
# │ │ ┌───────────── day of the month (1 - 31)
28-
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
29-
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
30-
# │ │ │ │ │
31-
# │ │ │ │ │
32-
# │ │ │ │ │
33-
# * * * * *
26+
# ┌───────────── hour (0 - 23)
27+
# │ ┌───────────── day of the month (1 - 31)
28+
# │ │ ┌───────────── month (1 - 12 or JAN-DEC)
29+
# │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
30+
# │ │ │ │
31+
# │ │ │ │
32+
# │ │ │ │
33+
# * * * * *
3434
- cron: '30 1 * * 0'
3535

3636
jobs:

lib/codeql.js

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

lib/codeql.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/defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"bundleVersion": "codeql-bundle-20201008"
2+
"bundleVersion": "codeql-bundle-20201028"
33
}

lib/init-action.js

Lines changed: 2 additions & 1 deletion
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.

src/codeql.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ function getCodeQLForCmd(cmd: string): CodeQL {
612612
memoryFlag,
613613
threadsFlag,
614614
databasePath,
615+
"--min-disk-free=1024", // Try to leave at least 1GB free
615616
"--format=sarif-latest",
616617
`--output=${sarifFile}`,
617618
addSnippetsFlag,

src/defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"bundleVersion": "codeql-bundle-20201008"
2+
"bundleVersion": "codeql-bundle-20201028"
33
}

src/init-action.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ async function run() {
119119
logger
120120
);
121121

122-
if (config.languages.includes(Language.python)) {
122+
if (
123+
config.languages.includes(Language.python) &&
124+
actionsUtil.getRequiredInput("setup-python-dependencies") === "true"
125+
) {
123126
try {
124127
await installPythonDeps(codeql, logger);
125128
} catch (err) {

0 commit comments

Comments
 (0)