Skip to content

Commit

Permalink
Use python 3.11 on Ubuntu/Debian ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lepapareil committed Dec 7, 2024
1 parent ca4b26f commit 1a13135
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ jobs:
if: always()
run: bin/check/hadolint.sh ./contrib/docker/Dockerfile

- name: Install Python 3.12
uses: actions/[email protected]
with:
python-version: '3.12'

- name: Install prerequisites
if: always()
run: |
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
- name: Checkout repository
uses: actions/[email protected]

- name: Environment
run: bin/environment.sh

- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh

Expand All @@ -30,12 +27,12 @@ jobs:
- name: Install Grcov
run: bin/install_grcov.sh

- name: Environment
run: bin/environment.sh

- name: Build
run: cargo build

- name: Test Prerequisites
run: bin/test/test_prerequisites.sh

- name: Run Coverage
run: bin/coverage_run.sh

Expand Down
42 changes: 23 additions & 19 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ jobs:
uses: actions/[email protected]
with:
ref: ${{ inputs.branch }}
- name: Install Python 3.10
- name: Install prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Python 3.11
uses: actions/[email protected]
with:
python-version: '3.10'
python-version: '3.11'
- name: Install python3 venv
run: |
bin/install_python3_venv.sh
Expand All @@ -34,10 +36,10 @@ jobs:
which python3
python3 --version
pip --version
- name: Install
run: |
bin/install_prerequisites_ubuntu.sh
bin/install_rust.sh
- name : Environment
run: bin/environment.sh
- name: Install rust
run: bin/install_rust.sh
- name: Build
run: |
bin/release/release.sh
Expand Down Expand Up @@ -120,28 +122,30 @@ jobs:
- name: Install package and tests integ
uses: addnab/docker-run-action@v3
with:
image: ubuntu
image: ubuntu:22.04
options: --volume ${{ github.workspace }}:/work --workdir /work --privileged
run: |
set -e
echo "::group::Install system prerequisites"
echo "::group::Install Prerequisites"
bin/install_prerequisites_ubuntu.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
echo "::group::Install python 3.11"
bin/install_pythonx_for_ubuntu.sh 11
bin/install_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
pip --version
echo "::endgroup::"
echo "::group::Install Rust"
bin/install_rust.sh
. "$HOME/.cargo/env"
echo "::endgroup::"
echo "::group::Environment"
bin/environment.sh
echo "::endgroup::"
echo "::group::Install generic linux package"
bin/release/install_generic_linux_package.sh
export PATH="/tmp/hurl-generic-linux/bin:$PATH"
export PATH="/tmp/hurl-generic-linux/bin:$PATH"
echo "::endgroup::"
echo "::group::Install tests prerequisites"
echo "::group::Install tests integ prerequisistes"
bin/test/test_prerequisites.sh
echo "::endgroup::"
echo "::group::Tests"
Expand Down Expand Up @@ -176,7 +180,7 @@ jobs:
run: |
set -e
echo "::group::Install system prerequisites"
bin/install_prerequisites_ubuntu.sh
bin/install_prerequisites_debian.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
bin/install_python3_venv.sh
Expand Down Expand Up @@ -389,12 +393,12 @@ jobs:
uses: actions/[email protected]
with:
ref: ${{ inputs.branch }}
- name: Install Python 3.10
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Python 3.11
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
run: |
bin/install_python3_venv.sh
Expand Down
73 changes: 47 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
ref: ${{ inputs.branch }}
- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Python 3.11
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
run: |
bin/install_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
python3 --version
pip --version
- name: Install Rust
run: bin/install_rust.sh
- name: Environment
Expand All @@ -48,6 +48,24 @@ jobs:
path: |
bench/server.log
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
ref: ${{ inputs.branch }}
- name: Install Rust
run: bin/install_rust.sh
- name: Install Python 3.11
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Environment
run: bin/environment.sh
- name: Coverage
run: bin/check/coverage.sh

test-ubuntu-x64-latest:
runs-on: ubuntu-latest
strategy:
Expand All @@ -58,20 +76,17 @@ jobs:
uses: actions/[email protected]
with:
ref: ${{ inputs.branch }}
- name: Install Python 3.10
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Python 3.11
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
run: |
bin/install_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
python3 --version
pip --version
- name: Install Rust
run: bin/install_rust.sh
- name: Environment
Expand All @@ -85,8 +100,6 @@ jobs:
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Integration Tests
run: bin/test/test_integ.sh
- name: Coverage
run: bin/check/coverage.sh
- name: Archive production artifacts
uses: actions/[email protected]
if: ${{ always() }}
Expand All @@ -107,20 +120,17 @@ jobs:
uses: actions/[email protected]
with:
ref: ${{ inputs.branch }}
- name: Install Python 3.10
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Python 3.11
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Install python3 venv
run: |
bin/install_python3_venv.sh
export PATH="/tmp/hurl-python3-venv/bin:$PATH"
echo "PATH=$PATH" >> $GITHUB_ENV
which python3
python3 --version
pip --version
- name: Install Rust
run: bin/install_rust.sh
- name: Environment
Expand Down Expand Up @@ -434,12 +444,16 @@ jobs:
with:
distribution: Ubuntu-22.04
wsl-version: 2
wsl-conf: |
[interop]
appendWindowsPath=false
- name: List wsl distribution
run: |
wsl --list --verbose --all
- shell: wsl-bash {0}
run: |
# Build, Test units and Integration tests
set -e
echo "::group::Move to linux compatible workspace"
win_workspace="${{ github.workspace }}"
wsl_workspace="/mnt/$(echo "${win_workspace}" | tr -d ':' | tr '\\' '/' | tr '[:upper:]' '[:lower:]')"
Expand All @@ -452,21 +466,28 @@ jobs:
echo "::group::Install Prerequisites"
bin/install_prerequisites_ubuntu.sh
echo "::endgroup::"
echo "::group::Install python3 venv"
echo "::group::Install python 3.11"
bin/install_pythonx_for_ubuntu.sh 11
bin/install_python3_venv.sh
export PATH=/tmp/hurl-python3-venv/bin:$PATH
which python3
python3 --version
pip --version
echo "::endgroup::"
echo "::group::Install tests integ prerequisistes"
bin/test/test_prerequisites.sh
echo "::endgroup::"
echo "::group::Install Rust"
bin/install_rust.sh
echo "::endgroup::"
echo "::group::Environment"
bin/environment.sh
echo "::endgroup::"
echo "::group::Tests"
bin/test/test.sh
echo "::group::Tests units"
bin/test/test_unit.sh
echo "::endgroup::"
echo "::group::Build"
bin/release/release.sh
export PATH="${PWD}/target/release:$PATH"
echo "::group::Tests integ"
bin/test/test_integ.sh
echo "::endgroup::"
- name: Archive production artifacts
uses: actions/[email protected]
Expand Down
35 changes: 35 additions & 0 deletions bin/install_prerequisites_debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -Eeuo pipefail

echo "----- install prerequisite packages -----"
if ! command -V sudo ; then
echo ":: Installing sudo"
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y install sudo
fi
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install \
bash \
software-properties-common \
expect \
curl \
net-tools \
g++-aarch64-linux-gnu \
libc6-dev-arm64-cross \
libxml2-dev \
pkg-config \
libcurl4-openssl-dev \
libxml2-utils \
libxml2-dev \
libssl-dev \
netcat-openbsd \
squid \
jq \
python3 \
python3-distutils \
python3-venv \
python3-dev
sudo service squid stop || true
sudo squid -k shutdown || true
sudo rm -v /dev/shm/squid*.shm >/dev/null 2>&1 || true

14 changes: 14 additions & 0 deletions bin/install_pythonx_for_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -Eeuo pipefail

python_version="${1:-11}"
sudo apt-get install -y software-properties-common
grep -R deadsnakes /etc/apt/ 2>/dev/null 2>&1 || sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install \
python3."${python_version}" \
python3."${python_version}"-dev \
python3."${python_version}"-venv
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3."${python_version}" 1 || true
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3."${python_version}" 1 || true
sudo curl -sS https://bootstrap.pypa.io/get-pip.py | python3."${python_version}"

0 comments on commit 1a13135

Please sign in to comment.