Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Codecov to GitHub Actions #564

Merged
merged 2 commits into from
Feb 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .ci/coverage.sh

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Code Coverage

on:
pull_request:
push:
branches:
- master
- develop

env:
LIBRARY: gil
UBSAN_OPTIONS: print_stacktrace=1

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: install packages
run: |
sudo apt update
sudo apt install g++ libpng-dev libjpeg-dev libtiff5-dev libraw-dev lcov python -y

- name: Setup Boost
run: |
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers

- name: Create user-config.jam
run: |
echo "using gcc : : g++ ;" > ~/user-config.jam

- name: Run tests
run: |
cd ../boost-root
./b2 -j3 libs/$LIBRARY/test coverage=on toolset=gcc cxxstd=11 variant=debug
lcov --directory bin.v2 --capture --no-external --directory $(pwd) --output-file coverage.info > /dev/null 2>&1
lcov --extract coverage.info $(pwd)'/boost/gil/*' --output-file coverage.info > /dev/null
lcov --list coverage.info

- name: Upload to Codecov
uses: codecov/codecov-action@v1.2.1
with:
files: ../boost-root/coverage.info