Skip to content

Commit

Permalink
Move main builds inside a container, add Ubuntu 24.04.
Browse files Browse the repository at this point in the history
This allows us to provide a clean build environment as well as
to extend os versions to be tested.
  • Loading branch information
sobomax committed Jun 17, 2024
1 parent 6943499 commit 764893f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 22 deletions.
50 changes: 33 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Main CI

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on all push or pull request events
push:
Expand All @@ -16,41 +16,57 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ubuntu:${{ matrix.os }}
env:
COMPILER: ${{ matrix.compiler }}
BUILD_OS: ${{ matrix.os }}
BUILD_OS: ubuntu-${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: ['gcc', 'clang', 'gcc-9', 'gcc-10', 'clang-9', 'clang-10']
os: [20.04, 22.04, 24.04]
compiler: ['gcc', 'clang']
include:
- os: ubuntu-22.04
compiler: 'gcc'
- os: ubuntu-22.04
compiler: 'clang'
- os: ubuntu-22.04
- os: 20.04
compiler: 'gcc-9'
- os: 20.04
compiler: 'gcc-10'
- os: 20.04
compiler: 'clang-9'
- os: 20.04
compiler: 'clang-10'
- os: 22.04
compiler: 'gcc-11'
- os: ubuntu-22.04
- os: 22.04
compiler: 'gcc-12'
- os: ubuntu-22.04
- os: 22.04
compiler: 'clang-11'
- os: ubuntu-22.04
- os: 22.04
compiler: 'clang-12'
- os: ubuntu-22.04
- os: 22.04
compiler: 'clang-13'
- os: ubuntu-22.04
- os: 22.04
compiler: 'clang-14'
- os: ubuntu-22.04
- os: 22.04
compiler: 'clang-15'
- os: 24.04
compiler: 'clang-16'
- os: 24.04
compiler: 'clang-17'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Install git
run: |
apt-get update
apt-get install -y git lsb-release gnupg2 wget
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
4 changes: 2 additions & 2 deletions scripts/build/build.conf.sub
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enable_ubuntu_toolchain_test() {
sudo apt install software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
${SUDO} env DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
${SUDO} add-apt-repository -y ppa:ubuntu-toolchain-r/test
}

setup_qemu() {
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/install_depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PKGS=$(cat "$(dirname $0)/apt_requirements.txt")
_PKGS=""
for pkg in ${PKGS}
do
if [ "${BUILD_OS}" = ubuntu-22.04 -a "${pkg}" = python-dev ]
if [ "${BUILD_OS}" != ubuntu-20.04 -a "${BUILD_OS}" != ubuntu-18.04 -a "${pkg}" = python-dev ]
then
pkg="python-dev-is-python3"
fi
Expand All @@ -29,7 +29,7 @@ ${SUDO} apt-get -y remove libmemcached11 libpq5
${SUDO} apt-get -y autoremove

PKGS="$PKGS $(. "$(dirname $0)/apt_requirements_postupdate.sh")"
${SUDO} apt-get -y --allow-downgrades install ${PKGS}
${SUDO} env DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install ${PKGS}

if [ ! -z "${POST_INSTALL_CMD}" ]
then
Expand Down
10 changes: 9 additions & 1 deletion scripts/build/reset_sources.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#!/bin/sh

. $(dirname $0)/build.conf.sub

RELEASE="$(lsb_release -cs)"
if [ "${RELEASE}" = "bookworm" ]
then
RELEASE="jammy"
fi
URL="http://archive.ubuntu.com/ubuntu"

echo "deb $URL $RELEASE main universe
deb $URL $RELEASE-updates main universe
deb $URL $RELEASE-security main universe" | sudo tee /etc/apt/sources.list > /dev/null
deb $URL $RELEASE-security main universe" | ${SUDO} tee /etc/apt/sources.list > /dev/null
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 871920D1991BC93C
gpg --export 871920D1991BC93C | ${SUDO} tee /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg > /dev/null

0 comments on commit 764893f

Please sign in to comment.