Merge pull request #338 from tetengo/boost_upgrade #521
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions Workflow | |
# Build with GCC on Linux | |
# Copyright 2019-2024 kaoru https://www.tetengo.org/ | |
name: Linux - GCC | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
tags: [ v* ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CONCURRENT_BUILD: 4 | |
GCC_COMMAND: gcc-12 | |
GXX_COMMAND: g++-12 | |
BOOST_VER: 1_87_0 | |
BOOST_VER_DOT: 1.87.0 | |
BOOST_BOOTSTRAP_TOOLSET: gcc | |
BOOST_TOOLSET: gcc-12 | |
BOOST_CACHE_REV: 0 | |
jobs: | |
boost_build: | |
name: Boost Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install dependencies | |
shell: bash | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install \ | |
gcc-12 \ | |
g++-12 | |
- name: Cache Boost build | |
uses: actions/cache@v4 | |
with: | |
path: .boost_build | |
key: Linux-GCC-Boost-${{ env.BOOST_VER }}-${{ env.BOOST_CACHE_REV }} | |
- name: Build Boost | |
shell: bash | |
run: | | |
if [ ! -e .boost_build/boost_${{ env.BOOST_VER }}/.build_finished ]; | |
then | |
mkdir -p .boost_build | |
cd .boost_build | |
curl -L -o boost_${{ env.BOOST_VER }}.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_VER_DOT }}/source/boost_${{ env.BOOST_VER }}.tar.bz2 | |
tar xvf boost_${{ env.BOOST_VER }}.tar.bz2 | |
cd boost_${{ env.BOOST_VER }} | |
./bootstrap.sh --with-toolset=${{ env.BOOST_BOOTSTRAP_TOOLSET }} | |
(./b2 -j ${{ env.CONCURRENT_BUILD }} toolset=${{ env.BOOST_TOOLSET }} variant=release link=static || :) | |
touch .build_finished | |
fi | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
needs: boost_build | |
steps: | |
- name: Install dependencies | |
shell: bash | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install \ | |
autoconf-archive \ | |
gcc-12 \ | |
g++-12 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Restore Boost build | |
uses: actions/cache@v4 | |
with: | |
path: .boost_build | |
key: Linux-GCC-Boost-${{ env.BOOST_VER }}-${{ env.BOOST_CACHE_REV }} | |
- name: Install Boost | |
shell: bash | |
run: | | |
cd .boost_build/boost_${{ env.BOOST_VER }} | |
(sudo ./b2 -j ${{ env.CONCURRENT_BUILD }} toolset=${{ env.BOOST_TOOLSET }} variant=release link=static install --prefix=/usr/local || :) | |
- name: Configure | |
shell: bash | |
run: | | |
export DISTCHECK_CONFIGURE_FLAGS=" \ | |
CC=${{ env.GCC_COMMAND }} \ | |
CXX=${{ env.GXX_COMMAND }} \ | |
" | |
./bootstrap.sh | |
mkdir -p .build | |
cd .build | |
../configure $DISTCHECK_CONFIGURE_FLAGS | |
- name: Build | |
shell: bash | |
run: | | |
export DISTCHECK_CONFIGURE_FLAGS=" \ | |
CC=${{ env.GCC_COMMAND }} \ | |
CXX=${{ env.GXX_COMMAND }} \ | |
" | |
export BOOST_TEST_LOG_LEVEL=warning | |
cd .build | |
make -j ${{ env.CONCURRENT_BUILD }} check |