ci: Use new codecov uploader (#2541)

* ci: Use new codecov uploader

The bash uploader is deprecated

Ref: https://about.codecov.io/blog/codecov-uploader-deprecation-plan/

* Collect coverage report using lcov

* Remove branch coverage

There are a lot of hidden branches in the C++ code which doesn't make it
very useful
This commit is contained in:
Patrick Ziegler 2021-10-16 19:58:34 +02:00 committed by GitHub
parent 4d90ac2f4c
commit b5fb44220d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,6 +95,10 @@ jobs:
libnl-genl-3-dev \ libnl-genl-3-dev \
libmpdclient-dev libmpdclient-dev
fi fi
if [ "$POLYBAR_BUILD_TYPE" = "tests" ]; then
sudo apt-get install -y lcov
fi
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: true submodules: true
@ -107,13 +111,28 @@ jobs:
run: | run: |
cd $BUILD_DIR cd $BUILD_DIR
make make
- name: Collect initial coverage
if: ${{ matrix.polybar_build_type == 'tests' }}
run: |
lcov --capture --initial --no-external --directory . -o cov_base.info
- name: Tests - name: Tests
if: ${{ matrix.polybar_build_type == 'tests' }} if: ${{ matrix.polybar_build_type == 'tests' }}
run: | run: |
cd $BUILD_DIR cd $BUILD_DIR
make check make check
cd $POLYBAR_DIR - name: Collect coverage
bash <(curl -s https://codecov.io/bash) -F unittests -a "-ap" -Z if: ${{ matrix.polybar_build_type == 'tests' }}
run: |
lcov --capture --no-external --directory . -o cov_tests.info
lcov --add-tracefile cov_base.info --add-tracefile cov_tests.info -o cov_total.info
lcov --remove cov_total.info ${PWD}'/build/*' ${PWD}'/tests/*' ${PWD}'/lib/*' -o cov.info
- name: Upload Coverage
if: ${{ matrix.polybar_build_type == 'tests' }}
uses: codecov/codecov-action@v2
with:
flags: unittests
files: ./cov.info
fail_ci_if_error: true
- name: Upload Logs - name: Upload Logs
if: failure() if: failure()
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2