mirror of
https://github.com/boostorg/core.git
synced 2025-07-30 04:47:24 +02:00
Updated GitHub Actions config for better configurability.
Reworked extra package installation and added explicit specification of external package sources. Moved some common constants to environment variables. Removed installation of unneeded packages in the containers.
This commit is contained in:
205
.github/workflows/ci.yml
vendored
205
.github/workflows/ci.yml
vendored
@ -20,6 +20,8 @@ concurrency:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
GIT_FETCH_JOBS: 8
|
GIT_FETCH_JOBS: 8
|
||||||
|
NET_RETRY_COUNT: 5
|
||||||
|
DEFAULT_BUILD_VARIANT: debug,release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
posix:
|
posix:
|
||||||
@ -31,150 +33,202 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
# Linux, gcc
|
||||||
- toolset: gcc-4.4
|
- toolset: gcc-4.4
|
||||||
cxxstd: "98,0x"
|
cxxstd: "98,0x"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: g++-4.4
|
install:
|
||||||
|
- g++-4.4
|
||||||
|
sources:
|
||||||
|
- "ppa:ubuntu-toolchain-r/test"
|
||||||
- toolset: gcc-4.6
|
- toolset: gcc-4.6
|
||||||
cxxstd: "03,0x"
|
cxxstd: "03,0x"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: g++-4.6
|
install:
|
||||||
|
- g++-4.6
|
||||||
|
sources:
|
||||||
|
- "ppa:ubuntu-toolchain-r/test"
|
||||||
- toolset: gcc-4.7
|
- toolset: gcc-4.7
|
||||||
cxxstd: "03,11"
|
cxxstd: "03,11"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: g++-4.7
|
install:
|
||||||
|
- g++-4.7
|
||||||
- toolset: gcc-4.8
|
- toolset: gcc-4.8
|
||||||
cxxstd: "03,11"
|
cxxstd: "03,11"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: g++-4.8
|
install:
|
||||||
|
- g++-4.8
|
||||||
- toolset: gcc-4.9
|
- toolset: gcc-4.9
|
||||||
cxxstd: "03,11"
|
cxxstd: "03,11"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: g++-4.9
|
install:
|
||||||
|
- g++-4.9
|
||||||
- toolset: gcc-5
|
- toolset: gcc-5
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "03,11,14,1z"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
|
install:
|
||||||
|
- g++-5
|
||||||
- toolset: gcc-6
|
- toolset: gcc-6
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "03,11,14,1z"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: g++-6
|
install:
|
||||||
|
- g++-6
|
||||||
- toolset: gcc-7
|
- toolset: gcc-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "03,11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
|
install:
|
||||||
|
- g++-7
|
||||||
- toolset: gcc-8
|
- toolset: gcc-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: g++-8
|
install:
|
||||||
|
- g++-8
|
||||||
- toolset: gcc-9
|
- toolset: gcc-9
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
|
install:
|
||||||
|
- g++-9
|
||||||
- toolset: gcc-10
|
- toolset: gcc-10
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
|
install:
|
||||||
|
- g++-10
|
||||||
- toolset: gcc-11
|
- toolset: gcc-11
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install: g++-11
|
install:
|
||||||
|
- g++-11
|
||||||
|
sources:
|
||||||
|
- "ppa:ubuntu-toolchain-r/test"
|
||||||
- name: UBSAN
|
- name: UBSAN
|
||||||
toolset: gcc-11
|
toolset: gcc-11
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
ubsan: 1
|
ubsan: 1
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install: g++-11
|
install:
|
||||||
|
- g++-11
|
||||||
|
sources:
|
||||||
|
- "ppa:ubuntu-toolchain-r/test"
|
||||||
|
|
||||||
|
# Linux, clang
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.5
|
compiler: clang++-3.5
|
||||||
cxxstd: "03,11"
|
cxxstd: "03,11"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: clang-3.5
|
install:
|
||||||
|
- clang-3.5
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.6
|
compiler: clang++-3.6
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: clang-3.6
|
install:
|
||||||
|
- clang-3.6
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.7
|
compiler: clang++-3.7
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: clang-3.7
|
install:
|
||||||
|
- clang-3.7
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.8
|
compiler: clang++-3.8
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install: clang-3.8
|
install:
|
||||||
|
- clang-3.8
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.9
|
compiler: clang++-3.9
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: clang-3.9
|
install:
|
||||||
|
- clang-3.9
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-4.0
|
compiler: clang++-4.0
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: clang-4.0
|
install:
|
||||||
|
- clang-4.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-5.0
|
compiler: clang++-5.0
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "03,11,14,1z"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: clang-5.0
|
install:
|
||||||
|
- clang-5.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-6.0
|
compiler: clang++-6.0
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "03,11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: clang-6.0
|
install:
|
||||||
|
- clang-6.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-7
|
compiler: clang++-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "03,11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: clang-7
|
install:
|
||||||
|
- clang-7
|
||||||
|
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-8
|
compiler: clang++-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
install: clang-8
|
install:
|
||||||
|
- clang-8
|
||||||
|
- g++-7
|
||||||
gcc_toolchain: 7
|
gcc_toolchain: 7
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-9
|
compiler: clang++-9
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install: clang-9
|
install:
|
||||||
|
- clang-9
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-10
|
compiler: clang++-10
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
|
install:
|
||||||
|
- clang-10
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-11
|
compiler: clang++-11
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
|
install:
|
||||||
|
- clang-11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-12
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
|
install:
|
||||||
|
- clang-12
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-12
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-20.04
|
|
||||||
install: libc++-12-dev libc++abi-12-dev
|
|
||||||
cxxflags: -stdlib=libc++
|
cxxflags: -stdlib=libc++
|
||||||
linkflags: -stdlib=libc++
|
linkflags: -stdlib=libc++
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install:
|
||||||
|
- clang-12
|
||||||
|
- libc++-12-dev
|
||||||
|
- libc++abi-12-dev
|
||||||
- name: UBSAN
|
- name: UBSAN
|
||||||
toolset: clang
|
toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-12
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "03,11,14,17,20"
|
||||||
ubsan: 1
|
|
||||||
os: ubuntu-20.04
|
|
||||||
install: libc++-12-dev libc++abi-12-dev
|
|
||||||
cxxflags: -stdlib=libc++
|
cxxflags: -stdlib=libc++
|
||||||
linkflags: -stdlib=libc++
|
linkflags: -stdlib=libc++
|
||||||
|
ubsan: 1
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install:
|
||||||
|
- clang-12
|
||||||
|
- libc++-12-dev
|
||||||
|
- libc++abi-12-dev
|
||||||
|
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
@ -188,20 +242,77 @@ jobs:
|
|||||||
container: ${{matrix.container}}
|
container: ${{matrix.container}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup container
|
- name: Setup environment
|
||||||
if: matrix.container
|
|
||||||
run: |
|
run: |
|
||||||
echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV
|
if [ -f "/etc/debian_version" ]
|
||||||
apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 install -y sudo software-properties-common tzdata wget curl apt-transport-https make apt-file unzip libssl-dev build-essential autotools-dev autoconf automake g++ libc++-helpers python ruby cpio gcc-multilib g++-multilib pkgconf python3 ccache libpython-dev git cmake
|
then
|
||||||
|
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
fi
|
||||||
|
if [ -n "${{matrix.container}}" ]
|
||||||
|
then
|
||||||
|
echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV
|
||||||
|
if [ -f "/etc/debian_version" ]
|
||||||
|
then
|
||||||
|
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
|
||||||
|
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ python python3 git cmake
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
git config --global pack.threads 0
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
run: |
|
run: |
|
||||||
for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done
|
SOURCE_KEYS=(${{join(matrix.source_keys, ' ')}})
|
||||||
sudo apt-get update
|
SOURCES=(${{join(matrix.sources, ' ')}})
|
||||||
sudo apt-get install -y ${{matrix.install}}
|
for key in "${SOURCE_KEYS[@]}"
|
||||||
|
do
|
||||||
|
for i in {1..$NET_RETRY_COUNT}
|
||||||
|
do
|
||||||
|
wget -O - "$key" | sudo apt-key add - && break || sleep 2
|
||||||
|
done
|
||||||
|
done
|
||||||
|
if [ ${#SOURCES[@]} -gt 0 ]
|
||||||
|
then
|
||||||
|
APT_ADD_REPO_COMMON_ARGS=("-y")
|
||||||
|
APT_ADD_REPO_HAS_SOURCE_ARGS=0
|
||||||
|
SOFTWARE_PROPERTIES_VERSION="$(dpkg-query --showformat='${Version}' --show software-properties-common)"
|
||||||
|
if dpkg --compare-versions "$SOFTWARE_PROPERTIES_VERSION" ge "0.96.24.20"
|
||||||
|
then
|
||||||
|
APT_ADD_REPO_COMMON_ARGS+=("-n")
|
||||||
|
fi
|
||||||
|
if dpkg --compare-versions "$SOFTWARE_PROPERTIES_VERSION" ge "0.98.10"
|
||||||
|
then
|
||||||
|
APT_ADD_REPO_HAS_SOURCE_ARGS=1
|
||||||
|
fi
|
||||||
|
for source in "${SOURCES[@]}"
|
||||||
|
do
|
||||||
|
for i in {1..$NET_RETRY_COUNT}
|
||||||
|
do
|
||||||
|
APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}")
|
||||||
|
if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ]
|
||||||
|
then
|
||||||
|
case "$source" in
|
||||||
|
"ppa:"*)
|
||||||
|
APT_ADD_REPO_ARGS+=("-P")
|
||||||
|
;;
|
||||||
|
"deb "*)
|
||||||
|
APT_ADD_REPO_ARGS+=("-S")
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
APT_ADD_REPO_ARGS+=("-U")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
APT_ADD_REPO_ARGS+=("$source")
|
||||||
|
sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
|
||||||
|
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}}
|
||||||
|
|
||||||
- name: Setup GCC Toolchain
|
- name: Setup GCC Toolchain
|
||||||
if: matrix.gcc_toolchain
|
if: matrix.gcc_toolchain
|
||||||
@ -249,24 +360,32 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
DEPINST_ARGS+=("$LIBRARY")
|
DEPINST_ARGS+=("$LIBRARY")
|
||||||
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
|
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
|
||||||
./bootstrap.sh
|
if [ -z "${{matrix.cmake_tests}}" ]
|
||||||
./b2 headers
|
|
||||||
|
|
||||||
- name: Create user-config.jam
|
|
||||||
if: matrix.cmake_tests == '' && matrix.compiler != ''
|
|
||||||
run: |
|
|
||||||
echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam
|
|
||||||
if [ -n "$GCC_TOOLCHAIN_ROOT" ]
|
|
||||||
then
|
then
|
||||||
echo -n " : <compileflags>\"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" <linkflags>\"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam
|
./bootstrap.sh
|
||||||
|
./b2 headers
|
||||||
|
if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ]
|
||||||
|
then
|
||||||
|
echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam
|
||||||
|
if [ -n "$GCC_TOOLCHAIN_ROOT" ]
|
||||||
|
then
|
||||||
|
echo -n " : <compileflags>\"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" <linkflags>\"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam
|
||||||
|
fi
|
||||||
|
echo " ;" >> ~/user-config.jam
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo " ;" >> ~/user-config.jam
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: matrix.cmake_tests == ''
|
if: matrix.cmake_tests == ''
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root
|
cd ../boost-root
|
||||||
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}" "variant=debug,release")
|
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}")
|
||||||
|
if [ -n "${{matrix.build_variant}}" ]
|
||||||
|
then
|
||||||
|
B2_ARGS+=("variant=${{matrix.build_variant}}")
|
||||||
|
else
|
||||||
|
B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT")
|
||||||
|
fi
|
||||||
if [ -n "${{matrix.threading}}" ]
|
if [ -n "${{matrix.threading}}" ]
|
||||||
then
|
then
|
||||||
B2_ARGS+=("threading=${{matrix.threading}}")
|
B2_ARGS+=("threading=${{matrix.threading}}")
|
||||||
|
Reference in New Issue
Block a user