@@ -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