From 764893f43559f5bf969b0d4d341251160a81618b Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Sun, 16 Jun 2024 15:53:43 -0700 Subject: [PATCH] Move main builds inside a container, add Ubuntu 24.04. This allows us to provide a clean build environment as well as to extend os versions to be tested. --- .github/workflows/main.yml | 50 +++++++++++++++++++++----------- scripts/build/build.conf.sub | 4 +-- scripts/build/install_depends.sh | 4 +-- scripts/build/reset_sources.sh | 10 ++++++- 4 files changed, 46 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb5ee4c2890..6b34bcc88fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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 diff --git a/scripts/build/build.conf.sub b/scripts/build/build.conf.sub index 3b91d322e8b..6c903fff759 100755 --- a/scripts/build/build.conf.sub +++ b/scripts/build/build.conf.sub @@ -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() { diff --git a/scripts/build/install_depends.sh b/scripts/build/install_depends.sh index 7aa33ef268a..845e4989d3c 100755 --- a/scripts/build/install_depends.sh +++ b/scripts/build/install_depends.sh @@ -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 @@ -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 diff --git a/scripts/build/reset_sources.sh b/scripts/build/reset_sources.sh index c29dd1e98c0..f7644ef3ea7 100755 --- a/scripts/build/reset_sources.sh +++ b/scripts/build/reset_sources.sh @@ -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