Skip to content

Commit

Permalink
Merge pull request #220 from boostorg/fix-python-container
Browse files Browse the repository at this point in the history
GHA: Fix installation of Python in Ubuntu 22+ containers
  • Loading branch information
Flamefire committed Nov 14, 2023
2 parents c2c7c19 + f6b8d39 commit 22e1200
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ jobs:
curl -sSL --retry ${NET_RETRY_COUNT:-5} 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE1DD270288B4E6030699E45FA1715D88E1DF1F24' | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/git-core_ubuntu_ppa.gpg
for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ python libpython-dev git
osver=$(lsb_release -sr | cut -f1 -d.)
pkgs="g++ git"
# Ubuntu 22+ has only Python 3 in the repos
if [ -n "$osver" ] && [ "$osver" -ge "22" ]; then
pkgs+=" python-is-python3 libpython3-dev"
else
pkgs+=" python libpython-dev"
fi
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs
fi
# For jobs not compatible with ccache, use "ccache: no" in the matrix
if [[ "${{ matrix.ccache }}" == "no" ]]; then
Expand Down

0 comments on commit 22e1200

Please sign in to comment.