Move the boost-root to a sibling folder

This keeps the correct paths of our files in the coverage data.
This commit is contained in:
Alexander Grund 2022-02-08 19:07:11 +01:00
parent a4d72a5bf4
commit 21913cab7d
No known key found for this signature in database
GPG key ID: AA48A0760367A42B

View file

@ -58,20 +58,13 @@ jobs:
timeout-minutes: 120 timeout-minutes: 120
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
env:
BOOST_ROOT: ${{github.workspace}}/boost-root
PROJECT_DIR: ${{github.workspace}}/repo
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
if: '!matrix.coverage'
with: with:
path: ${{env.PROJECT_DIR}} # For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
- uses: actions/checkout@v2 fetch-depth: ${{ matrix.coverage && '0' || '1' }}
if: 'matrix.coverage'
with:
path: ${{env.PROJECT_DIR}}
fetch-depth: 0
# Checking out Boost and all its submodules takes ages... # Checking out Boost and all its submodules takes ages...
- name: Cache Boost - name: Cache Boost
uses: actions/cache@v2 uses: actions/cache@v2
@ -105,6 +98,9 @@ jobs:
fi fi
echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV
echo "using $B2_TOOLSET : : $CXX ;" > ~/user-config.jam echo "using $B2_TOOLSET : : $CXX ;" > ~/user-config.jam
# Move the Boost root to a sibling folder
mv boost-root ..
echo "BOOST_ROOT=${{github.workspace}}/../boost-root" >> $GITHUB_ENV
- name: Cache ccache - name: Cache ccache
uses: hendrikmuhs/ccache-action@v1 uses: hendrikmuhs/ccache-action@v1
@ -112,11 +108,10 @@ jobs:
key: ${{matrix.os}}-${{matrix.compiler}}-${{matrix.boostBranch}} key: ${{matrix.os}}-${{matrix.compiler}}-${{matrix.boostBranch}}
- name: Prepare boost - name: Prepare boost
working-directory: boost-root working-directory: ${{env.BOOST_ROOT}}
run: ./bootstrap.sh && ./b2 headers run: ./bootstrap.sh && ./b2 headers
- name: Boost build - name: Boost build
working-directory: ${{env.PROJECT_DIR}}
run: | run: |
if [[ "${{matrix.boostBranch}}" == "master" ]]; then if [[ "${{matrix.boostBranch}}" == "master" ]]; then
B2_FLAGS="cxxstd=${{matrix.cxxstd}}" B2_FLAGS="cxxstd=${{matrix.cxxstd}}"
@ -130,33 +125,30 @@ jobs:
- name: Collect coverage - name: Collect coverage
if: matrix.coverage if: matrix.coverage
working-directory: ${{env.PROJECT_DIR}}
run: | run: |
lcov --version lcov --version
lcov --gcov-tool=gcov-8 --directory "$PROJECT_DIR/test" --base-directory "$BOOST_ROOT" --capture --output-file all.info lcov --gcov-tool=gcov-8 --directory "$GITHUB_WORKSPACE/test" --capture --output-file all.info
# dump a summary on the console # dump a summary on the console
lcov --list all.info lcov --list all.info
# Limit to our files (header-only in this case) # Limit to our files (header-only in this case)
lcov --extract all.info "$PROJECT_DIR/include/*" --output-file coverage.info lcov --extract all.info "$GITHUB_WORKSPACE/include/*" --output-file coverage.info
# Output what was collected # Output what was collected
lcov --list coverage.info lcov --list coverage.info
- name: Upload coverage - name: Upload coverage
if: matrix.coverage if: matrix.coverage
uses: coverallsapp/github-action@master uses: coverallsapp/github-action@master
with: with:
path-to-lcov: ${{env.PROJECT_DIR}}/coverage.info path-to-lcov: ${{github.workspace}}/coverage.info
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
base-path: ${{env.PROJECT_DIR}}
- name: Build required boost libs - name: Build required boost libs
working-directory: boost-root working-directory: ${{env.BOOST_ROOT}}
run: | run: |
./b2 --toolset=$B2_TOOLSET --with-test --with-thread --with-chrono --with-system --with-atomic --with-date_time -a -j3 ./b2 --toolset=$B2_TOOLSET --with-test --with-thread --with-chrono --with-system --with-atomic --with-date_time -a -j3
# Add lib folder to LD_LIBRARY_PATH, so the tests can load them # Add lib folder to LD_LIBRARY_PATH, so the tests can load them
echo "LD_LIBRARY_PATH=$PWD/stage/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$PWD/stage/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: CMake build - name: CMake build
working-directory: ${{env.PROJECT_DIR}}
run: | run: |
mkdir build && cd build mkdir build && cd build
CXX_STANDARD="${{matrix.cxxstd}}" CXX_STANDARD="${{matrix.cxxstd}}"
@ -164,7 +156,7 @@ jobs:
cmake --build . --config Debug -- -j3 cmake --build . --config Debug -- -j3
ctest --output-on-failure --build-config Debug -j3 ctest --output-on-failure --build-config Debug -j3
- name: Cleanup Boost folder - name: Cleanup Boost folder to reduce cache usage
if: ${{ always() }} if: ${{ always() }}
working-directory: boost-root working-directory: ${{env.BOOST_ROOT}}
run: git clean -fxd run: git clean -fxd