Skip to content

Commit d50fad0

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

File tree

2 files changed

+38
-117
lines changed

2 files changed

+38
-117
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: 37 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -20,75 +20,51 @@ 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
38-
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
39-
with:
40-
python-version: "3.10"
41-
42-
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
44-
with:
45-
languages: cpp
46-
47-
- name: "[Win] Initialize vcpkg"
48-
if: matrix.os == 'windows-latest'
49-
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
50-
with:
51-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
52-
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
53-
vcpkgJsonGlob: '**/vcpkg.json'
54-
55-
- name: "[Win] Install dependencies"
56-
if: matrix.os == 'windows-latest'
34+
- name: Echo a message
5735
run: |
58-
vcpkg install
59-
python3 -m pip install -r third_party/requirements.txt
60-
61-
- name: "[Lin] Install apt packages"
62-
if: matrix.os == 'ubuntu-latest'
36+
echo "Hello, World!"
37+
echo "$env:USERNAME"
38+
echo "$(Get-Command python)"
39+
echo "$env:PATH"
40+
shell: pwsh
41+
42+
- name: Set an environment variable
43+
run: echo "MY_VAR=some_value" >> $GITHUB_ENV
44+
shell: pwsh
45+
46+
- name: Use the environment variable
6347
run: |
64-
sudo apt-get update
65-
sudo apt-get install -y cmake clang libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
48+
echo $env:GITHUB_ENV
49+
echo "${{ env.MY_VAR }}"
50+
shell: pwsh
6651

67-
# Latest distros do not allow global pip installation
68-
- name: "[Lin] Install Python requirements in venv"
69-
if: matrix.os == 'ubuntu-latest'
52+
- name: Check for Python >= 3.10
53+
id: check_python
7054
run: |
71-
python3 -m venv .venv
72-
. .venv/bin/activate
73-
echo "$PATH" >> $GITHUB_PATH
74-
python3 -m pip install -r third_party/requirements.txt
75-
76-
- name: Configure CMake
77-
run: >
78-
cmake
79-
-B ${{env.BUILD_DIR}}
80-
${{matrix.extra_build_option}}
81-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
82-
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
83-
-DUMF_FORMAT_CODE_STYLE=OFF
84-
-DUMF_DEVELOPER_MODE=ON
85-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
86-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
87-
-DUMF_BUILD_CUDA_PROVIDER=ON
88-
-DUMF_TESTS_FAIL_ON_SKIP=ON
89-
90-
- name: Build
91-
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
92-
93-
- name: Perform CodeQL Analysis
94-
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
55+
$pythonCommand = Get-Command python -ErrorAction SilentlyContinue
56+
if ($pythonCommand) {
57+
$pythonVersion = python --version 2>&1
58+
$versionPattern = 'Python (\d+)\.(\d+)\.(\d+)'
59+
echo $pythonVersion
60+
if ($pythonVersion -match $versionPattern) {
61+
$major = [int]$matches[1]
62+
$minor = [int]$matches[2]
63+
if ($major -gt 3 -or ($major -eq 3 -and $minor -ge 10)) {
64+
echo "##[set-output name=python_exists;]true"
65+
}
66+
}
67+
}
68+
shell: pwsh
69+
70+

0 commit comments

Comments
 (0)