Skip to content

Commit 85c65cd

Browse files
committed
Always use the latest CodeQL in the Python dependencies tests.
1 parent 65efaf8 commit 85c65cd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/python-deps.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- name: Initialize CodeQL
4646
uses: github/codeql-action/init@v1
4747
with:
48+
tools: latest
4849
languages: python
4950

5051
- name: Test Auto Package Installation
@@ -60,7 +61,8 @@ jobs:
6061
esac
6162
echo ${basePath}
6263
63-
find ${basePath}/hostedtoolcache/CodeQL -path "*x64/codeql" -exec $GITHUB_WORKSPACE/python-setup/auto_install_packages.py {} \;
64+
codeql_version="0.0.0-$(cat "$GITHUB_WORKSPACE/src/defaults.json" | jq -r .bundleVersion | rev | cut -d - -f 1 | rev)"
65+
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "${basePath}/hostedtoolcache/CodeQL/$codeql_version/x64/codeql"
6466
- name: Setup for extractor
6567
run: |
6668
echo $CODEQL_PYTHON
@@ -105,7 +107,7 @@ jobs:
105107
- name: Initialize CodeQL
106108
uses: github/codeql-action/init@v1
107109
with:
108-
tools: https://github.com/github/codeql-action/releases/download/codeql-bundle-20200826/codeql-bundle.tar.gz
110+
tools: latest
109111
languages: python
110112

111113
- name: Test Auto Package Installation
@@ -114,13 +116,16 @@ jobs:
114116
powershell -File $cmd
115117
116118
cd $Env:GITHUB_WORKSPACE\\${{ matrix.test_dir }}
117-
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\0.0.0-20200826\\x64\\codeql
119+
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
120+
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
121+
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
122+
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
118123
- name: Setup for extractor
119124
run: |
120125
echo $Env:CODEQL_PYTHON
121126
122-
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
127+
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
123128
- name: Verify packages installed
124129
run: |
125130
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1"
126-
powershell -File $cmd ${{ matrix.python_version }}
131+
powershell -File $cmd ${{ matrix.python_version }}

0 commit comments

Comments
 (0)