Skip to content

Commit

Permalink
Merge branch 'main' into jhutchings1-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert authored and GitHub committed Oct 30, 2020
2 parents 762078e + 7d5b76a commit 736f65d
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 20 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/python-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ jobs:
- uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: ./init
with:
tools: latest
languages: python
setup-python-dependencies: false

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: ./init
with:
tools: latest
languages: python
setup-python-dependencies: false

- name: Test Auto Package Installation
run: |
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
powershell -File $cmd
cd $Env:GITHUB_WORKSPACE\\${{ matrix.test_dir }}
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\0.0.0-20200826\\x64\\codeql
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
- name: Setup for extractor
run: |
echo $Env:CODEQL_PYTHON
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
- name: Verify packages installed
run: |
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1"
powershell -File $cmd ${{ matrix.python_version }}
powershell -File $cmd ${{ matrix.python_version }}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ on:
pull_request:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
# ┌───────────── hour (0 - 23)
# │ ┌───────────── day of the month (1 - 31)
# │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │
# │ │ │ │
# │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
Expand Down
1 change: 1 addition & 0 deletions lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/defaults.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"bundleVersion": "codeql-bundle-20201008"
"bundleVersion": "codeql-bundle-20201028"
}
3 changes: 2 additions & 1 deletion lib/init-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ function getCodeQLForCmd(cmd: string): CodeQL {
memoryFlag,
threadsFlag,
databasePath,
"--min-disk-free=1024", // Try to leave at least 1GB free
"--format=sarif-latest",
`--output=${sarifFile}`,
addSnippetsFlag,
Expand Down
2 changes: 1 addition & 1 deletion src/defaults.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"bundleVersion": "codeql-bundle-20201008"
"bundleVersion": "codeql-bundle-20201028"
}
5 changes: 4 additions & 1 deletion src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ async function run() {
logger
);

if (config.languages.includes(Language.python)) {
if (
config.languages.includes(Language.python) &&
actionsUtil.getRequiredInput("setup-python-dependencies") === "true"
) {
try {
await installPythonDeps(codeql, logger);
} catch (err) {
Expand Down

0 comments on commit 736f65d

Please sign in to comment.