Skip to content

Commit 9ebed2f

Browse files
committed
Add integration test
Also: - Update changelog - Fix comments in check_python script
1 parent d091652 commit 9ebed2f

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test that the workaround for python 3.12 on windows works
2+
3+
on:
4+
push:
5+
branches: [main, releases/v2]
6+
pull_request:
7+
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
8+
# by other workflows.
9+
types: [opened, synchronize, reopened, ready_for_review]
10+
schedule:
11+
# Weekly on Monday.
12+
- cron: '0 0 * * 1'
13+
workflow_dispatch:
14+
15+
jobs:
16+
test-setup-python-scripts:
17+
timeout-minutes: 45
18+
runs-on: windows-latest
19+
20+
steps:
21+
- uses: setup-python@v4
22+
with:
23+
python-version: 3.12
24+
25+
- uses: actions/checkout@v4
26+
27+
- name: Prepare test
28+
uses: ./.github/actions/prepare-test
29+
with:
30+
version: default
31+
32+
- name: Initialize CodeQL
33+
uses: ./../init
34+
with:
35+
tools: latest
36+
languages: python
37+
38+
- name: Analyze
39+
uses: ./../action/analyze
40+
with:
41+
upload-database: false

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7-
No user facing changes.
7+
- Add a workaround python 3.12, which is not supported in CodeQL CLI version 2.14.6 or earlier. If you are running an analysis on windows and using python 3.12 or later, the CodeQL Action will switch to running python 3.11.
88

99
## 2.22.0 - 06 Oct 2023
1010

python-setup/check_python12.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
# If we are running greater than or equal to python 3.12, change py to run version 3.11
55
Write-Host "Checking python version"
66
if ((py -3 -c "import sys; print(0 if sys.version_info >= (3, 12) else 1)") -eq "0") {
7-
Write-Host "Python 3.12+ detected, setting PY_PYTHON3=3.11"
7+
Write-Host "python 3.12+ detected, setting PY_PYTHON3=3.11"
88
# First make sure we have python 3.11 installed
99
py -3.11 -c "import imp"
1010
if ($LASTEXITCODE -eq 0) {
11-
Write-Host "Python 3.11 detected, using this version instead of 3.12+."
11+
Write-Host "python 3.11 detected, using this version instead of 3.12+."
1212
Write-Output "PY_PYTHON3=3.11" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
1313
} else {
14-
Write-Host "FAILURE: Python 3.12+ is not supported. Please install Python 3.11."
14+
Write-Host "FAILURE: Python 3.12+ is not supported, and Python 3.11 could not be detected on the system. Please install Python 3.11."
1515
exit 1
1616
}
1717
} else {
18-
Write-Host "Python 3.12+ not detected, not making any changes."
18+
Write-Host "python 3.12+ not detected, not making any changes."
1919
}

0 commit comments

Comments
 (0)