Skip to content

Commit 5658bfe

Browse files
committed
fix for python install on self-hosted runners
1 parent b3bbdd4 commit 5658bfe

File tree

2 files changed

+25
-64
lines changed

2 files changed

+25
-64
lines changed

.github/workflows/pr_push.yml

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,9 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
CodeChecks:
20-
uses: ./.github/workflows/reusable_checks.yml
21-
DocsBuild:
22-
uses: ./.github/workflows/reusable_docs_build.yml
23-
FastBuild:
24-
name: Fast builds
25-
needs: [CodeChecks, DocsBuild]
26-
uses: ./.github/workflows/reusable_fast.yml
27-
Build:
28-
name: Basic builds
29-
needs: [FastBuild]
30-
uses: ./.github/workflows/reusable_basic.yml
31-
DevDax:
32-
needs: [FastBuild]
33-
uses: ./.github/workflows/reusable_dax.yml
34-
Sanitizers:
35-
needs: [FastBuild]
36-
uses: ./.github/workflows/reusable_sanitizers.yml
37-
Qemu:
38-
needs: [FastBuild]
39-
uses: ./.github/workflows/reusable_qemu.yml
40-
Benchmarks:
41-
needs: [Build]
42-
uses: ./.github/workflows/reusable_benchmarks.yml
43-
ProxyLib:
44-
needs: [Build]
45-
uses: ./.github/workflows/reusable_proxy_lib.yml
46-
GPU:
47-
needs: [Build]
48-
uses: ./.github/workflows/reusable_gpu.yml
49-
Valgrind:
50-
needs: [Build]
51-
uses: ./.github/workflows/reusable_valgrind.yml
52-
MultiNuma:
53-
needs: [Build]
54-
uses: ./.github/workflows/reusable_multi_numa.yml
55-
Coverage:
56-
# total coverage (on upstream only)
57-
if: github.repository == 'oneapi-src/unified-memory-framework'
58-
needs: [Build, DevDax, GPU, MultiNuma, Qemu, ProxyLib]
59-
uses: ./.github/workflows/reusable_coverage.yml
60-
secrets: inherit
61-
with:
62-
trigger: "${{github.event_name}}"
63-
Coverage_partial:
64-
# partial coverage (on forks)
65-
if: github.repository != 'oneapi-src/unified-memory-framework'
66-
needs: [Build, Qemu, ProxyLib]
67-
uses: ./.github/workflows/reusable_coverage.yml
6819
CodeQL:
69-
needs: [Build]
7020
permissions:
7121
contents: read
7222
security-events: write
7323
uses: ./.github/workflows/reusable_codeql.yml
74-
Trivy:
75-
needs: [Build]
76-
permissions:
77-
contents: read
78-
security-events: write
79-
uses: ./.github/workflows/reusable_trivy.yml
24+

.github/workflows/reusable_codeql.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,37 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [ubuntu-latest, windows-latest]
24-
include:
25-
- os: ubuntu-latest
26-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
27-
extra_build_option: '-DCMAKE_BUILD_TYPE=Release'
28-
- os: windows-latest
29-
runs-on: ${{matrix.os}}
23+
os: [windows-latest]
24+
25+
# TODO revert
26+
runs-on: ["codeql-test", "Windows"]
3027

3128
steps:
3229
- name: Checkout repository
3330
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3431
with:
3532
fetch-depth: 0
3633

37-
- name: Setup newer Python
34+
- name: Check for Python >= 3.10
35+
id: check_python
36+
run: |
37+
$pythonCommand = Get-Command python -ErrorAction SilentlyContinue
38+
if ($pythonCommand) {
39+
$pythonVersion = python --version 2>&1
40+
$versionPattern = 'Python (\d+)\.(\d+)\.(\d+)'
41+
echo $pythonVersion
42+
if ($pythonVersion -match $versionPattern) {
43+
$major = [int]$matches[1]
44+
$minor = [int]$matches[2]
45+
if ($major -gt 3 -or ($major -eq 3 -and $minor -ge 10)) {
46+
echo "##[set-output name=python_exists;]true"
47+
}
48+
}
49+
}
50+
shell: pwsh
51+
52+
- name: Setup Python 3.10
53+
if: steps.check_python.outputs.python_exists == 'false'
3854
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
3955
with:
4056
python-version: "3.10"

0 commit comments

Comments
 (0)