Skip to content

Commit

Permalink
Switch to venv on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
olszomal committed Nov 5, 2024
1 parent 56e57bd commit bc60f4c
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,30 +153,14 @@ jobs:
- name: Install python3 cryptography module (Windows)
if: runner.os == 'Windows'
run: |
.\venv\Scripts\Activate.ps1
python.exe -m ensurepip
python.exe -m pip install --upgrade pip
python.exe -m pip install cryptography
python.exe -c "import sys; print(sys.executable)"
python.exe --version
python.exe -c "import cryptography; print(f'Python3 cryptography version {cryptography.__version__}')"
- name: Find the latest version of Python (Windows)
if: runner.os == 'Windows'
run: |
$pythonVersions = Get-ChildItem -Path "C:/hostedtoolcache/windows/Python/" -Directory | Where-Object { $_.Name -match '\d+\.\d+\.\d+' } | Sort-Object { [Version]($_.Name) } -Descending
if ($pythonVersions.Count -gt 0) {
$latestPythonVersion = $pythonVersions[0].Name
$pythonPath = "C:/hostedtoolcache/windows/Python/$latestPythonVersion/x64"
Write-Output "Latest Python version found: $latestPythonVersion"
Write-Output "Python directory path: $pythonPath"
$env:Path = "$pythonPath;" + $env:Path
Write-Output "Updated PATH environment variable:"
Write-Output $env:Path
} else {
Write-Error "No Python versions found in C:/hostedtoolcache/windows/Python/"
exit 1
}
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
run: |
Expand All @@ -190,8 +174,21 @@ jobs:
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/dist" \
-DPython3_EXECUTABLE="${{ github.workspace }}/venv/bin/python"
- name: Configure CMake (non-macOS)
if: runner.os != 'macOS'
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: |
.\venv\Scripts\Activate.ps1
cmake \
-G "${{ matrix.generator }}" \
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/build" \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/dist" \
-DPython3_EXECUTABLE="${{ github.workspace }}/venv/bin/python"
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: cmake
-G "${{matrix.generator}}"
-S ${{github.workspace}}
Expand Down Expand Up @@ -220,8 +217,15 @@ jobs:
source ../venv/bin/activate
ctest -C ${{env.BUILD_TYPE}}
- name: Test (non-macOS)
if: runner.os != 'macOS'
- name: Test (Windows)
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/build
run: |
..\venv\Scripts\Activate.ps1
ctest -C ${{env.BUILD_TYPE}}
- name: Test (Linux)
if: runner.os == 'Linux'
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

Expand Down

0 comments on commit bc60f4c

Please sign in to comment.