Skip to content

Commit

Permalink
Use same version of boost for all CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed May 12, 2021
1 parent cf1b845 commit dbe45f7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 25 deletions.
19 changes: 19 additions & 0 deletions .github/actions/boost-download/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Download boost headers"
description: "Downloads boost headers"
runs:
using: "composite"
steps:
- name: Install Boost
shell: bash
run: |
if [ "$OS" == "Windows_NT" ]; then
# fix up paths to be forward slashes consistently
BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g')
fi
mkdir -p $BOOST_ROOT
curl --progress-bar --location --output $BOOST_ROOT/download.tar.bz2 $BOOST_URL
7z -o$BOOST_ROOT x $BOOST_ROOT/download.tar.bz2 -y -bd
7z -o$BOOST_ROOT x $BOOST_ROOT/download.tar -y -bd
cd $BOOST_ROOT && cp -r boost_*/* .
rm -rf boost_*/* download.tar.bz2 download.tar
12 changes: 12 additions & 0 deletions .github/actions/boost-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Prepare boost env vars"
description: "Set boost url and target location"
runs:
using: "composite"
steps:
- name: Set boost env vars
shell: sh
run: |
echo "BOOST_ROOT=${{github.workspace}}/3rdparty/boost" >> $GITHUB_ENV
echo "BOOST_URL=https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2/download" >> $GITHUB_ENV
2 changes: 1 addition & 1 deletion .github/actions/docker-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
- name: configure
shell: sh
run: |
docker run --env KLOGG_VERSION=$KLOGG_VERSION --env KLOGG_BUILD_ROOT=$KLOGG_BUILD_ROOT --env KLOGG_CMAKE_OPTS="$KLOGG_CMAKE_OPTS" -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "/opt/bin/cmake -B /usr/local/$KLOGG_BUILD_ROOT $KLOGG_CMAKE_OPTS /usr/local"
docker run --env BOOST_ROOT="/usr/local/3rdparty/boost" --env KLOGG_VERSION=$KLOGG_VERSION --env KLOGG_BUILD_ROOT=$KLOGG_BUILD_ROOT --env KLOGG_CMAKE_OPTS="$KLOGG_CMAKE_OPTS" -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "/opt/bin/cmake -B /usr/local/$KLOGG_BUILD_ROOT $KLOGG_CMAKE_OPTS /usr/local"
- name: build
shell: sh
Expand Down
59 changes: 35 additions & 24 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ jobs:
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install g++-8 libboost-all-dev ragel -y
sudo apt-get install g++-8 ragel -y
- uses: ./.github/actions/boost-env
- name: Restore Boost cache
uses: actions/cache@v2
id: cache-boost
with:
path: ${{env.BOOST_ROOT}}
key: ${{env.BOOST_URL}}
- uses: ./.github/actions/boost-download
if: steps.cache-boost.outputs.cache-hit != 'true'

#Build and test
- uses: ./.github/actions/klogg-version
Expand Down Expand Up @@ -125,6 +135,16 @@ jobs:
cd docker/centos8
docker build -t ${{ matrix.config.container }} .
- uses: ./.github/actions/boost-env
- name: Restore Boost cache
uses: actions/cache@v2
id: cache-boost
with:
path: ${{env.BOOST_ROOT}}
key: ${{env.BOOST_URL}}
- uses: ./.github/actions/boost-download
if: steps.cache-boost.outputs.cache-hit != 'true'

- uses: ./.github/actions/klogg-version
- uses: ./.github/actions/prepare-workspace-env
- uses: ./.github/actions/docker-build
Expand Down Expand Up @@ -188,8 +208,17 @@ jobs:
- name: Brew deps
run: |
brew install ragel
brew install boost
- uses: ./.github/actions/boost-env
- name: Restore Boost cache
uses: actions/cache@v2
id: cache-boost
with:
path: ${{env.BOOST_ROOT}}
key: ${{env.BOOST_URL}}
- uses: ./.github/actions/boost-download
if: steps.cache-boost.outputs.cache-hit != 'true'

#Build and test
- uses: ./.github/actions/klogg-version
- uses: ./.github/actions/prepare-workspace-env
Expand Down Expand Up @@ -317,34 +346,16 @@ jobs:
echo "SSL_DIR=${{ github.workspace }}\openssl-1.1\${{ matrix.config.arch }}\bin" >> $GITHUB_ENV
echo "SSL_ARCH=${{ matrix.config.ssl_arch }}" >> $GITHUB_ENV
- name: Set boost paths
shell: sh
run: |
echo "BOOST_ROOT=${{github.workspace}}/3rdparty/boost" >> $GITHUB_ENV
echo "BOOST_URL=https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download" >> $GITHUB_ENV
- uses: ./.github/actions/boost-env
- name: Restore Boost cache
uses: actions/cache@v2
id: cache-boost
with:
path: ${{env.BOOST_ROOT}}
key: boost

- name: Install Boost
key: ${{env.BOOST_URL}}
- uses: ./.github/actions/boost-download
if: steps.cache-boost.outputs.cache-hit != 'true'
shell: bash
run: |
if [ "$OS" == "Windows_NT" ]; then
# fix up paths to be forward slashes consistently
BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g')
fi
mkdir -p $BOOST_ROOT
curl --progress-bar --location --output $BOOST_ROOT/download.tar.bz2 $BOOST_URL
7z -o$BOOST_ROOT x $BOOST_ROOT/download.tar.bz2 -y -bd
7z -o$BOOST_ROOT x $BOOST_ROOT/download.tar -y -bd
cd $BOOST_ROOT && cp -r boost_*/* .
rm -rf boost_*/* download.tar.bz2 download.tar

#Build and test
- name: Prepare dev cmd
uses: ilammy/msvc-dev-cmd@v1
Expand Down

0 comments on commit dbe45f7

Please sign in to comment.