Skip to content

Commit faf15fe

Browse files
committed
Initial coverage workflow
1 parent 7f3f8b0 commit faf15fe

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

.github/workflows/coverage.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Coverage
22

3-
on:
4-
push:
5-
branches:
6-
- develop
3+
on: push
4+
# push:
5+
# branches:
6+
# - develop
7+
78
jobs:
89
posix:
910
defaults:
@@ -18,30 +19,32 @@ jobs:
1819
steps:
1920
- name: Checkout
2021
uses: actions/checkout@v3
21-
- name: Install CMake
22-
run: sudo apt-get -y install cmake
23-
- name: Install lcov
24-
run: sudo apt-get -y install lcov
25-
- name: Install compiler
26-
run: sudo apt-get -y install g++-11
27-
- name: Install Redis
28-
run: sudo apt-get -y install redis-server
29-
- name: Install boost
30-
uses: MarkusJx/[email protected]
31-
id: install-boost
32-
with:
33-
boost_version: 1.81.0
34-
platform_version: 22.04
22+
23+
- name: Install dependencies
24+
run: sudo apt-get --no-install-recommends -y install cmake lcov g++-11 redis-server
25+
26+
- name: Setup Boost
27+
run: ./tools/ci.py setup-boost --source-dir=$(pwd)
28+
29+
- name: Build Boost
30+
run: ./tools/ci.py build-b2-distro --toolset=gcc-11
31+
32+
# Having our library there confuses the coverage reports
33+
- name: Remove Boost.Redis from the b2 distro
34+
run: rm -rf ~/boost-b2-distro/include/boost/redis
35+
3536
- name: Run CMake
36-
run: |
37-
BOOST_ROOT=${{steps.install-boost.outputs.BOOST_ROOT}} cmake --preset coverage .
37+
run: cmake -DCMAKE_PREFIX_PATH=$HOME/boost-b2-distro --preset coverage .
38+
3839
- name: Build
3940
run: cmake --build --preset coverage
41+
4042
- name: Test
4143
run: ctest --preset coverage
44+
4245
- name: Make the coverage file
4346
run: cmake --build --preset coverage --target coverage
47+
4448
- name: Upload to codecov
4549
run: |
46-
bash <(curl -s https://codecov.io/bash) -f ./build/coverage/coverage.info || echo "Codecov did not collect coverage reports"
47-
50+
bash <(curl -s https://codecov.io/bash) -f ./build/coverage/coverage.info

0 commit comments

Comments
 (0)