Skip to content

Commit

Permalink
Merge branch 'main' into 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 ea5ae18 + f0c568a commit fb10307
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 12 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 }}
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 fb10307

Please sign in to comment.