Skip to content

Commit

Permalink
Windows ci uses python venv
Browse files Browse the repository at this point in the history
  • Loading branch information
lepapareil committed Dec 30, 2024
1 parent fb7f2b8 commit 090a9f0
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install prerequisites
if: always()
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
Expand Down
41 changes: 22 additions & 19 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
echo "::endgroup::"
echo "::group::Install python 3.11"
bin/install_pythonx_for_ubuntu.sh 11
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
echo "::endgroup::"
echo "::group::Install Rust"
Expand Down Expand Up @@ -182,8 +182,8 @@ jobs:
echo "::group::Install system prerequisites"
bin/install_prerequisites_debian.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
bin/install_python3_venv.sh
echo "::group::Activate python3 venv"
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
Expand Down Expand Up @@ -233,8 +233,8 @@ jobs:
echo "::group::Install system prerequisites"
bin/install_prerequisites_archlinux.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
bin/install_python3_venv.sh
echo "::group::Activate python3 venv"
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
Expand Down Expand Up @@ -287,8 +287,8 @@ jobs:
echo "::group::Install system prerequisites"
bin/install_prerequisites_fedora.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
bin/install_python3_venv.sh
echo "::group::Activate python3 venv"
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
Expand Down Expand Up @@ -361,7 +361,7 @@ jobs:
bash bin/install_prerequisites_alpine.sh
echo "::endgroup::"
echo "::group::Install tests prerequisites"
bash bin/install_python3_venv.sh
bash bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
Expand Down Expand Up @@ -399,9 +399,9 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
Expand Down Expand Up @@ -448,9 +448,9 @@ jobs:
run: |
bin/install_prerequisites_macos.sh
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
Expand Down Expand Up @@ -497,9 +497,9 @@ jobs:
run: |
bin/install_prerequisites_macos.sh
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
Expand Down Expand Up @@ -563,21 +563,24 @@ jobs:
with:
python-version: '3.11'
- name: Environment
run: .\bin\environment.ps1
- name: Build
run: |
.\bin\release\release.ps1
.\bin\activate_python3_venv.ps1
.\bin\environment.ps1
- name: Build
run: .\bin\release\release.ps1
- name: Create windows64 Zip package
run: .\bin\release\create_windows64_zip_package.ps1
- name: Install win64 zip and test integ
run: |
.\bin\activate_python3_venv.ps1
.\bin\release\install_windows64_zip_package.ps1
.\bin\test\test_prerequisites.ps1
.\bin\test\test_integ.ps1
- name: Create windows64 installer
run: .\bin\release\create_windows64_installer.ps1
- name: Install win64 installer and test integ
run: |
.\bin\activate_python3_venv.ps1
.\bin\release\install_windows64_installer.ps1
.\bin\test\test_prerequisites.ps1
.\bin\test\test_integ.ps1
Expand Down
56 changes: 33 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
- name: Install Rust
run: bin/install_rust.sh
Expand Down Expand Up @@ -82,9 +82,9 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install Rust
Expand Down Expand Up @@ -126,9 +126,9 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install Rust
Expand Down Expand Up @@ -171,8 +171,8 @@ jobs:
echo "::group::Install Prerequisites"
bin/install_prerequisites_archlinux.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
bin/install_python3_venv.sh
echo "::group::Activate python3 venv"
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
Expand Down Expand Up @@ -215,8 +215,8 @@ jobs:
echo "::group::Install Prerequisites"
bin/install_prerequisites_fedora.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
bin/install_python3_venv.sh
echo "::group::Activate python3 venv"
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
Expand Down Expand Up @@ -262,8 +262,8 @@ jobs:
echo "::group::Install Prerequisites"
bin/install_prerequisites_alpine.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
bin/install_python3_venv.sh
echo "::group::Activate python3 venv"
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
Expand Down Expand Up @@ -304,9 +304,9 @@ jobs:
run: |
bin/install_prerequisites_macos.sh
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
Expand Down Expand Up @@ -352,9 +352,9 @@ jobs:
run: |
bin/install_prerequisites_macos.sh
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install python3 venv
- name: Activate python3 venv
run: |
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
Expand Down Expand Up @@ -403,8 +403,7 @@ jobs:
with:
ref: ${{ inputs.branch }}
- name: Install Rust
run: |
.\bin\install_rust.ps1
run: .\bin\install_rust.ps1
- name: Manage vcpkg cache
uses: actions/[email protected]
with:
Expand All @@ -416,10 +415,21 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Environment
run: .\bin\environment.ps1
- name: Build and test
run: .\bin\test\test.ps1
- name: Build, Test units and Integration tests
run: |
# Build, Test units and Integration tests
echo "::group::Install prerequisites"
.\bin\install_prerequisites_windows.ps1
echo "::endgroup::"
echo "::group::Activate python3 venv"
.\bin\activate_python3_venv.ps1
echo "::endgroup::"
echo "::group::Environment"
.\bin\environment.ps1
echo "::endgroup::"
echo "::group::Tests"
.\bin\test\test.ps1
echo "::endgroup::"
- name: Archive production artifacts
uses: actions/[email protected]
if: ${{ always() }}
Expand Down Expand Up @@ -468,7 +478,7 @@ jobs:
echo "::endgroup::"
echo "::group::Install python 3.11"
bin/install_pythonx_for_ubuntu.sh 11
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
echo "::endgroup::"
echo "::group::Install tests integ prerequisistes"
Expand Down
9 changes: 9 additions & 0 deletions bin/activate_python3_venv.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'

write-host -foregroundcolor Cyan "----- activate python venv -----"

python -m venv "$env:TMP\venv"
. $env:TMP\venv\Scripts\activate.ps1
python -m pip install --upgrade pip --quiet

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# shellcheck source=/dev/null
set -Eeuo pipefail

echo "----- install python3 venv -----"
echo "----- activate python3 venv -----"
python3 -m venv /tmp/hurl-python3-venv
source /tmp/hurl-python3-venv/bin/activate
python3 -m pip install --upgrade pip --quiet
Expand Down
6 changes: 4 additions & 2 deletions bin/environment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ vcpkg --version
if ($LASTEXITCODE) { Throw }

write-host "# python"
(Get-Command -Name python -CommandType Application).Source
Get-command python | Format-Table -Wrap -Autosize
python -V
if ($LASTEXITCODE) { Throw }
(Get-Command -Name pip -CommandType Application).Source

write-host "# pip"
Get-command pip | Format-Table -Wrap -Autosize
pip --version
if ($LASTEXITCODE) { Throw }

Expand Down
8 changes: 7 additions & 1 deletion bin/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ echo "# python3"
if command -V python3 ; then
which python3
python3 -V
else
echo "No python3 installed"
fi

echo "# pip"
if command -V pip ; then
which pip
pip --version
else
echo "No python3 installed"
echo "No pip installed"
fi

echo "# curl"
Expand Down
2 changes: 1 addition & 1 deletion contrib/cross_compile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bin/release/create_tarball.sh linux
```
bin/release/install_generic_linux_package.sh
export PATH="/tmp/hurl-generic-linux:${PATH}"
bin/install_python3_venv.sh
bin/activate_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
bin/test/test_prerequisites.sh
bin/test/test_integ.sh
Expand Down

0 comments on commit 090a9f0

Please sign in to comment.