11# Copyright 2020-2021 Peter Dimov
22# Copyright 2021 Andrey Semashev
3- # Copyright 2021-2024 Alexander Grund
3+ # Copyright 2021-2025 Alexander Grund
44# Copyright 2022 James E. King III
55#
66# Distributed under the Boost Software License, Version 1.0.
@@ -120,28 +120,31 @@ jobs:
120120 fi
121121 if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
122122 apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
123- apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common curl
123+ apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no- install-suggests --no-install-recommends install sudo software-properties-common curl
124124 # Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80
125125 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
126126 for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
127127 apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
128128 osver=$(lsb_release -sr | cut -f1 -d.)
129- pkgs="g++ git"
129+ pkgs="g++ git xz-utils "
130130 # Ubuntu 22+ has only Python 3 in the repos
131131 if [ -n "$osver" ] && [ "$osver" -ge "22" ]; then
132132 pkgs+=" python-is-python3 libpython3-dev"
133133 else
134134 pkgs+=" python libpython-dev"
135135 fi
136- apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs
136+ apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no- install-suggests --no-install-recommends install $pkgs
137137 fi
138138 # For jobs not compatible with ccache, use "ccache: no" in the matrix
139139 if [[ "${{ matrix.ccache }}" == "no" ]]; then
140140 echo "B2_USE_CCACHE=0" >> $GITHUB_ENV
141141 fi
142+ if [[ "${{ matrix.sanitize }}" == "yes" ]]; then
143+ echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/test/suppressions.txt" >> $GITHUB_ENV
144+ fi
142145 git config --global pack.threads 0
143146 if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
144- # Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
147+ # Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
145148 curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217
146149 fi
147150 ! command -v cmake &> /dev/null || echo "B2_FLAGS=--nowide-enable-cmake" >> $GITHUB_ENV
@@ -157,9 +160,7 @@ jobs:
157160 with :
158161 path : ~/.ccache
159162 key : ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}}
160- restore-keys : |
161- ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
162- ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}
163+ restore-keys : ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
163164
164165 - name : Fetch Boost.CI
165166 uses : actions/checkout@v4
@@ -177,37 +178,33 @@ jobs:
177178 - name : Install packages
178179 if : startsWith(matrix.os, 'ubuntu')
179180 run : |
180- SOURCE_KEYS=(${{join(matrix.source_keys, ' ')}})
181- SOURCES=(${{join(matrix.sources, ' ')}})
181+ SOURCE_KEYS=(" ${{join(matrix.source_keys, '" " ')}}" )
182+ SOURCES=(" ${{join(matrix.sources, '" " ')}}" )
182183 # Add this by default
184+ SOURCE_KEYS+=('http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F')
183185 SOURCES+=(ppa:ubuntu-toolchain-r/test)
184- for key in "${SOURCE_KEYS[@]}"; do
185- for i in {1..$NET_RETRY_COUNT}; do
186- keyfilename=$(basename -s .key $key)
187- curl -sSL --retry ${NET_RETRY_COUNT:-5} "$key" | sudo gpg --dearmor > /etc/apt/trusted.gpg.d/${keyfilename} && break || sleep 10
188- done
189- done
190- for source in "${SOURCES[@]}"; do
191- for i in {1..$NET_RETRY_COUNT}; do
192- sudo add-apt-repository $source && break || sleep 10
193- done
194- done
186+
187+ ci/add-apt-keys.sh "${SOURCE_KEYS[@]}"
188+ # Initial update before adding sources required to get e.g. keys
189+ sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
190+ ci/add-apt-repositories.sh "${SOURCES[@]}"
191+
195192 sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
196193 if [[ -z "${{matrix.install}}" ]]; then
197194 pkgs="${{matrix.compiler}}"
198195 pkgs="${pkgs/gcc-/g++-}"
199196 else
200197 pkgs="${{matrix.install}}"
201198 fi
202- sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs
199+ sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no- install-suggests --no-install-recommends install $pkgs
203200
204201 - name : Setup GCC Toolchain
205202 if : matrix.gcc_toolchain
206203 run : |
207204 GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain"
208205 echo "GCC_TOOLCHAIN_ROOT=$GCC_TOOLCHAIN_ROOT" >> $GITHUB_ENV
209206 if ! command -v dpkg-architecture; then
210- apt-get install -y dpkg-dev
207+ apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install dpkg-dev
211208 fi
212209 MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
213210 mkdir -p "$GCC_TOOLCHAIN_ROOT"
@@ -218,15 +215,11 @@ jobs:
218215
219216 - name : Setup multiarch
220217 if : matrix.multiarch
221- run : |
222- sudo apt-get install --no-install-recommends -y binfmt-support qemu-user-static
223- sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
224- git clone https://github.com/jeking3/bdde.git
225- echo "$(pwd)/bdde/bin/linux" >> ${GITHUB_PATH}
226- echo "BDDE_DISTRO=${{ matrix.distro }}" >> ${GITHUB_ENV}
227- echo "BDDE_EDITION=${{ matrix.edition }}" >> ${GITHUB_ENV}
228- echo "BDDE_ARCH=${{ matrix.arch }}" >> ${GITHUB_ENV}
229- echo "B2_WRAPPER=bdde" >> ${GITHUB_ENV}
218+ env :
219+ BDDE_DISTRO : ${{matrix.distro}}
220+ BDDE_EDITION : ${{matrix.edition}}
221+ BDDE_ARCH : ${{matrix.arch}}
222+ run : ci/github/setup_bdde.sh
230223
231224 - name : Setup Boost
232225 env :
@@ -235,6 +228,13 @@ jobs:
235228 B2_CXXSTD : ${{matrix.cxxstd}}
236229 B2_SANITIZE : ${{matrix.sanitize}}
237230 B2_STDLIB : ${{matrix.stdlib}}
231+ # More entries can be added in the same way, see the B2_ARGS assignment in ci/enforce.sh for the possible keys.
232+ # B2_DEFINES: ${{matrix.defines}}
233+ # Variables set here (to non-empty) will override the top-level environment variables, e.g.
234+ # B2_VARIANT: ${{matrix.variant}}
235+ # Set the (B2) target(s) to build, defaults to the test folder of the current library
236+ # Can alternatively be done like this in the build step or in the build command of the build step, e.g. `run: B2_TARGETS=libs/$SELF/doc ci/build.sh`
237+ # B2_TARGETS: libs/foo/test//bar
238238 run : source ci/github/install.sh
239239
240240 - name : Setup coverage collection
@@ -252,16 +252,15 @@ jobs:
252252
253253 - name : Collect coverage
254254 if : matrix.coverage
255- run : ci/codecov.sh "upload"
256- env :
257- BOOST_CI_CODECOV_IO_UPLOAD : skip
255+ run : ci/codecov.sh "collect"
258256
259257 - name : Upload coverage
260258 if : matrix.coverage
261259 uses : codecov/codecov-action@v5
262260 with :
261+ fail_ci_if_error : true
263262 disable_search : true
264- file : coverage.info
263+ files : coverage.info
265264 name : Github Actions
266265 token : ${{secrets.CODECOV_TOKEN}}
267266 verbose : true
0 commit comments