@@ -29,377 +29,14 @@ concurrency:
2929 group : ${{format('{0}:{1}', github.repository, github.ref)}}
3030 cancel-in-progress : true
3131
32- env :
33- GIT_FETCH_JOBS : 8
34- NET_RETRY_COUNT : 5
35- B2_CI_VERSION : 1
36- B2_VARIANT : debug,release
37- B2_LINK : shared,static
38- LCOV_BRANCH_COVERAGE : 0
39- CODECOV_NAME : Github Actions
40-
4132jobs :
42- posix :
43- defaults :
44- run :
45- shell : bash
46-
47- strategy :
48- fail-fast : false
49- matrix :
50- include :
51- # Linux, gcc
52- - { compiler: gcc-4.4, cxxstd: '98,0x', os: ubuntu-latest, container: 'ubuntu:16.04' }
53- - { compiler: gcc-4.6, cxxstd: '03,0x', os: ubuntu-latest, container: 'ubuntu:16.04' }
54- - { compiler: gcc-4.7, cxxstd: '03,11', os: ubuntu-latest, container: 'ubuntu:16.04' }
55- - { compiler: gcc-4.8, cxxstd: '03,11', os: ubuntu-latest, container: 'ubuntu:16.04' }
56- - { compiler: gcc-4.9, cxxstd: '03,11', os: ubuntu-latest, container: 'ubuntu:16.04' }
57- - { compiler: gcc-5, cxxstd: '03,11,14,1z', os: ubuntu-latest, container: 'ubuntu:18.04' }
58- - { compiler: gcc-6, cxxstd: '11,14,17', os: ubuntu-latest, container: 'ubuntu:18.04' }
59- - { compiler: gcc-7, cxxstd: '11,14,17', os: ubuntu-latest, container: 'ubuntu:20.04' }
60- - { compiler: gcc-8, cxxstd: '11,14,17,2a', os: ubuntu-latest, container: 'ubuntu:20.04' }
61- - { compiler: gcc-9, cxxstd: '11,14,17,2a', os: ubuntu-22.04 }
62- - { compiler: gcc-10, cxxstd: '11,14,17,20', os: ubuntu-22.04 }
63- - { compiler: gcc-11, cxxstd: '11,14,17,20', os: ubuntu-22.04 }
64- - { compiler: gcc-12, cxxstd: '11,14,17,20', os: ubuntu-22.04 }
65- - { compiler: gcc-13, cxxstd: '11,14,17,20,2b', os: ubuntu-24.04 }
66- - { compiler: gcc-14, cxxstd: '11,14,17,20,2b', os: ubuntu-24.04 }
67-
68- - { name: GCC w/ sanitizers, sanitize: yes,
69- compiler : gcc-13, cxxstd: '11,14,17,20', os: ubuntu-24.04 }
70- - { name: Collect coverage, coverage: yes,
71- compiler : gcc-8, cxxstd: '11,2a', os: ubuntu-latest, container: 'ubuntu:20.04', install: 'g++-8-multilib', address-model: '32,64' }
72-
73- # Linux, clang
74- - { compiler: clang-3.5, cxxstd: '11', os: ubuntu-latest, container: 'ubuntu:16.04' }
75- - { compiler: clang-3.6, cxxstd: '11,14', os: ubuntu-latest, container: 'ubuntu:16.04' }
76- - { compiler: clang-3.7, cxxstd: '11,14', os: ubuntu-latest, container: 'ubuntu:16.04' }
77- - { compiler: clang-3.8, cxxstd: '11,14', os: ubuntu-latest, container: 'ubuntu:16.04' }
78- - { compiler: clang-3.9, cxxstd: '11,14', os: ubuntu-latest, container: 'ubuntu:18.04' }
79- - { compiler: clang-4.0, cxxstd: '11,14', os: ubuntu-latest, container: 'ubuntu:18.04' }
80- - { compiler: clang-5.0, cxxstd: '11,14,1z', os: ubuntu-latest, container: 'ubuntu:18.04' }
81- - { compiler: clang-6.0, cxxstd: '11,14,17', os: ubuntu-latest, container: 'ubuntu:20.04' }
82- - { compiler: clang-7, cxxstd: '11,14,17', os: ubuntu-latest, container: 'ubuntu:20.04' }
83- # Note: clang-8 does not fully support C++20, so it is not compatible with some libstdc++ versions in this mode
84- - { compiler: clang-8, cxxstd: '11,14,17', os: ubuntu-latest, container: 'ubuntu:20.04' }
85- - { compiler: clang-9, cxxstd: '11,14,17,2a', os: ubuntu-latest, container: 'ubuntu:20.04' }
86- - { compiler: clang-10, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:20.04' }
87- - { compiler: clang-11, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:20.04' }
88- - { compiler: clang-12, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:20.04' }
89- - { compiler: clang-13, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:22.04' }
90- - { compiler: clang-14, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:22.04' }
91- - { compiler: clang-15, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:22.04' }
92- - { compiler: clang-16, cxxstd: '11,14,17,20,2b', os: ubuntu-24.04 }
93- - { compiler: clang-17, cxxstd: '11,14,17,20,23', os: ubuntu-latest, container: 'ubuntu:24.04' }
94- - { compiler: clang-18, cxxstd: '11,14,17,20,23,2c', os: ubuntu-24.04 }
95-
96- # libc++
97- - { compiler: clang-6.0, cxxstd: '11,14', os: ubuntu-latest, container: 'ubuntu:18.04', stdlib: libc++, install: 'clang-6.0 libc++-dev libc++abi-dev' }
98- - { compiler: clang-12, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:20.04', stdlib: libc++ }
99- - { name: Clang w/ sanitizers, sanitize: yes,
100- compiler : clang-17, cxxstd: '11,14,17,20', os: ubuntu-latest, container: 'ubuntu:24.04', stdlib: libc++ }
101-
102- # OSX, clang
103- - { name: MacOS w/ clang and sanitizers,
104- compiler : clang, cxxstd: '11,14,17,20,2b', os: macos-13, sanitize: yes }
105- - { compiler: clang, cxxstd: '11,14,17,20,2b', os: macos-14 }
106- - { compiler: clang, cxxstd: '11,14,17,20,2b', os: macos-15 }
107-
108- timeout-minutes : 120
109- runs-on : ${{matrix.os}}
110- container :
111- image : ${{matrix.container}}
112- volumes :
113- - /node20217:/node20217:rw,rshared
114- - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
115- env : {B2_USE_CCACHE: 1}
116-
117- steps :
118- - name : Setup environment
119- run : |
120- if [ -f "/etc/debian_version" ]; then
121- echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
122- export DEBIAN_FRONTEND=noninteractive
123- fi
124- if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
125- apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
126- apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install sudo software-properties-common curl
127- # Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80
128- 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
129- for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
130- apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
131- osver=$(lsb_release -sr | cut -f1 -d.)
132- pkgs="g++ git xz-utils"
133- # Ubuntu 22+ has only Python 3 in the repos
134- if [ -n "$osver" ] && [ "$osver" -ge "20" ]; then
135- pkgs+=" python-is-python3 libpython3-dev"
136- else
137- pkgs+=" python libpython-dev"
138- fi
139- apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install $pkgs
140- fi
141- # For jobs not compatible with ccache, use "ccache: no" in the matrix
142- if [[ "${{ matrix.ccache }}" == "no" ]]; then
143- echo "B2_USE_CCACHE=0" >> $GITHUB_ENV
144- fi
145- if [[ "${{ matrix.sanitize }}" == "yes" ]]; then
146- echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/test/suppressions.txt" >> $GITHUB_ENV
147- fi
148- git config --global pack.threads 0
149- if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
150- # Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
151- 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
152- fi
153- ! command -v cmake &> /dev/null || echo "B2_FLAGS=--nowide-enable-cmake" >> $GITHUB_ENV
154-
155- - uses : actions/checkout@v4
156- with :
157- # For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
158- fetch-depth : ${{ matrix.coverage && '0' || '1' }}
159-
160- - name : Cache ccache
161- uses : actions/cache@v4
162- if : env.B2_USE_CCACHE
163- with :
164- path : ~/.ccache
165- key : ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}}
166- restore-keys : ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
167-
168- - name : Fetch Boost.CI
169- uses : actions/checkout@v4
170- with :
171- repository : boostorg/boost-ci
172- ref : master
173- path : boost-ci-cloned
174-
175- - name : Get CI scripts folder
176- run : |
177- # Copy ci folder if not testing Boost.CI
178- [[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci .
179- rm -rf boost-ci-cloned
180-
181- - name : Install packages
182- if : startsWith(matrix.os, 'ubuntu')
183- run : |
184- SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}")
185- SOURCES=("${{join(matrix.sources, '" "')}}")
186- # Add this by default
187- SOURCE_KEYS+=('http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F')
188- SOURCES+=(ppa:ubuntu-toolchain-r/test)
189-
190- ci/add-apt-keys.sh "${SOURCE_KEYS[@]}"
191- # Initial update before adding sources required to get e.g. keys
192- sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
193- ci/add-apt-repositories.sh "${SOURCES[@]}"
194-
195- sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
196- if [[ -z "${{matrix.install}}" ]]; then
197- compiler="${{matrix.compiler}}"
198- pkgs="${compiler/gcc-/g++-}"
199- [[ -z "${{matrix.gcc_toolchain}}" ]] || pkgs+=" g++-${{matrix.gcc_toolchain}}"
200- if [[ "${{matrix.stdlib}}" == "libc++" && $compiler == "clang-"* ]]; then
201- ver=${compiler#*-}
202- pkgs+=" libc++-${ver}-dev libc++abi-${ver}-dev"
203- fi
204- else
205- pkgs="${{matrix.install}}"
206- fi
207- sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install $pkgs
208-
209- - name : Setup GCC Toolchain
210- if : matrix.gcc_toolchain
211- run : |
212- GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain"
213- echo "GCC_TOOLCHAIN_ROOT=$GCC_TOOLCHAIN_ROOT" >> $GITHUB_ENV
214- if ! command -v dpkg-architecture; then
215- apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install dpkg-dev
216- fi
217- MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
218- mkdir -p "$GCC_TOOLCHAIN_ROOT"
219- ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include"
220- ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin"
221- mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET"
222- ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}"
223-
224- - name : Setup multiarch
225- if : matrix.multiarch
226- run : ci/github/setup_bdde.sh
227- env :
228- BDDE_DISTRO : ${{matrix.distro}}
229- BDDE_EDITION : ${{matrix.edition}}
230- BDDE_ARCH : ${{matrix.arch}}
231-
232- - name : Setup Boost
233- env :
234- B2_ADDRESS_MODEL : ${{matrix.address-model}}
235- B2_COMPILER : ${{matrix.compiler}}
236- B2_CXXSTD : ${{matrix.cxxstd}}
237- B2_SANITIZE : ${{matrix.sanitize}}
238- B2_STDLIB : ${{matrix.stdlib}}
239- # More entries can be added in the same way, see the B2_ARGS assignment in ci/enforce.sh for the possible keys.
240- # B2_DEFINES: ${{matrix.defines}}
241- # Variables set here (to non-empty) will override the top-level environment variables, e.g.
242- # B2_VARIANT: ${{matrix.variant}}
243- # Set the (B2) target(s) to build, defaults to the test folder of the current library
244- # 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`
245- # B2_TARGETS: libs/foo/test//bar
246- run : source ci/github/install.sh
247-
248- - name : Setup coverage collection
249- if : matrix.coverage
250- run : ci/github/codecov.sh "setup"
251-
252- - name : Run tests
253- if : ' !matrix.coverity'
254- run : ci/build.sh
255-
256- - name : Run tests with simulated no LFS support
257- env :
258- B2_FLAGS : boost.nowide.lfs=no
259- run : ci/build.sh
260-
261- - name : Collect coverage
262- if : matrix.coverage
263- run : ci/codecov.sh "collect"
264-
265- - name : Upload coverage
266- if : matrix.coverage
267- uses : codecov/codecov-action@v5
268- with :
269- fail_ci_if_error : true
270- disable_search : true
271- files : coverage.info
272- name : ${{env.CODECOV_NAME}} (POSIX)
273- token : ${{secrets.CODECOV_TOKEN}}
274- verbose : true
275-
276- - name : Run coverity
277- if : matrix.coverity && github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'master')
278- run : ci/github/coverity.sh
279- env :
280- COVERITY_SCAN_NOTIFICATION_EMAIL : ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
281- COVERITY_SCAN_TOKEN : ${{ secrets.COVERITY_SCAN_TOKEN }}
282-
283- MSYS2 :
284- defaults :
285- run :
286- shell : msys2 {0}
287- strategy :
288- fail-fast : false
289- matrix :
290- include :
291- - { sys: MINGW32, compiler: gcc, cxxstd: '03,11,17,20' }
292- - { sys: MINGW64, compiler: gcc, cxxstd: '03,11,17,20' }
293-
294- runs-on : windows-latest
295-
296- steps :
297- - uses : actions/checkout@v4
298-
299- - name : Setup MSYS2 environment
300- uses : msys2/setup-msys2@v2
301- with :
302- msystem : ${{matrix.sys}}
303- update : true
304- install : git python
305- pacboy : gcc:p cmake:p ninja:p
306-
307- - name : Fetch Boost.CI
308- uses : actions/checkout@v4
309- with :
310- repository : boostorg/boost-ci
311- ref : master
312- path : boost-ci-cloned
313- - name : Get CI scripts folder
314- run : |
315- # Copy ci folder if not testing Boost.CI
316- [[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci .
317- rm -rf boost-ci-cloned
318-
319- - name : Setup Boost
320- env :
321- B2_COMPILER : ${{matrix.compiler}}
322- B2_CXXSTD : ${{matrix.cxxstd}}
323- B2_SANITIZE : ${{matrix.sanitize}}
324- B2_STDLIB : ${{matrix.stdlib}}
325- run : ci/github/install.sh
326-
327- - name : Run tests
328- run : ci/build.sh
329-
330- # Run also the CMake tests to avoid having to setup another matrix for CMake on MSYS
331- - name : Run CMake tests
332- run : |
333- cd "$BOOST_ROOT"
334- mkdir __build_cmake_test__ && cd __build_cmake_test__
335- cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DBoost_VERBOSE=ON ..
336- cmake --build . --target tests --config Debug -j$B2_JOBS
337- ctest --output-on-failure --build-config Debug
338-
339- CMake :
340- defaults :
341- run :
342- shell : bash
343-
344- strategy :
345- fail-fast : false
346- matrix :
347- include :
348- - { os: ubuntu-latest, build_shared: ON, build_type: Debug, generator: 'Unix Makefiles' }
349- - { os: ubuntu-latest, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' }
350- - { os: windows-2022, build_shared: ON, build_type: Debug, generator: 'Visual Studio 17 2022' }
351- - { os: windows-2022, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 17 2022' }
352-
353- timeout-minutes : 120
354- runs-on : ${{matrix.os}}
355-
356- steps :
357- - uses : actions/checkout@v4
358- - name : Fetch Boost.CI
359- uses : actions/checkout@v4
360- with :
361- repository : boostorg/boost-ci
362- ref : master
363- path : boost-ci-cloned
364- - name : Get CI scripts folder
365- run : |
366- # Copy ci folder if not testing Boost.CI
367- [[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci .
368- rm -rf boost-ci-cloned
369- - name : Setup Boost
370- env : {B2_DONT_BOOTSTRAP: 1}
371- run : source ci/github/install.sh
372-
373- - name : Run CMake tests
374- run : |
375- cd "$BOOST_ROOT"
376- mkdir __build_cmake_test__ && cd __build_cmake_test__
377- cmake -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{matrix.build_shared}} -DBUILD_TESTING=ON -DBoost_VERBOSE=ON ..
378- cmake --build . --target tests --config ${{matrix.build_type}} -j$B2_JOBS
379- ctest --output-on-failure --build-config ${{matrix.build_type}}
380-
381- - name : Run CMake subdir tests
382- run : |
383- cmake_test_folder="$BOOST_ROOT/libs/$SELF/test/cmake_test" # New unified folder
384- [ -d "$cmake_test_folder" ] || cmake_test_folder="$BOOST_ROOT/libs/$SELF/test/cmake_subdir_test"
385- cd "$cmake_test_folder"
386- mkdir __build_cmake_subdir_test__ && cd __build_cmake_subdir_test__
387- cmake -G "${{matrix.generator}}" -DBOOST_CI_INSTALL_TEST=OFF -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.build_shared}} ..
388- cmake --build . --config ${{matrix.build_type}} -j$B2_JOBS
389- ctest --output-on-failure --build-config ${{matrix.build_type}}
33+ call-boost-ci :
34+ name : Run Boost.CI
35+ uses : boostorg/boost-ci/.github/workflows/reusable.yml@master
36+ with :
37+ branch_coverage : false
38+ secrets :
39+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
40+ COVERITY_SCAN_NOTIFICATION_EMAIL : ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
41+ COVERITY_SCAN_TOKEN : ${{ secrets.COVERITY_SCAN_TOKEN }}
39042
391- - name : Install Library
392- run : |
393- cd "$BOOST_ROOT"
394- mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__
395- cmake -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{matrix.build_shared}} -DCMAKE_INSTALL_PREFIX=$HOME/local -DBoost_VERBOSE=ON -DBoost_DEBUG=ON ..
396- cmake --build . --target install --config ${{matrix.build_type}} -j$B2_JOBS
397- - name : Run CMake install tests
398- run : |
399- cmake_test_folder="$BOOST_ROOT/libs/$SELF/test/cmake_test" # New unified folder
400- [ -d "$cmake_test_folder" ] || cmake_test_folder="$BOOST_ROOT/libs/$SELF/test/cmake_install_test"
401- cd "$cmake_test_folder"
402- mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__
403- cmake -G "${{matrix.generator}}" -DBOOST_CI_INSTALL_TEST=ON -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.build_shared}} -DCMAKE_PREFIX_PATH=$HOME/local ..
404- cmake --build . --config ${{matrix.build_type}} -j$B2_JOBS
405- ctest --output-on-failure --build-config ${{matrix.build_type}}
0 commit comments