-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move code coverage to GitHub Actions (#176)
First step to move the build to GitHub Actions: move the coverage generation from Travis to Actions. It doesn't generate additional information with lcov anymore, and now always runs on the latest available Ubuntu. [ci skip]
- Loading branch information
Showing
2 changed files
with
52 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Coverage Upload to Codecov | ||
|
||
on: | ||
push: | ||
branches: | ||
- coverage-action | ||
- master | ||
- develop | ||
- 2.0.0-develop | ||
paths: | ||
- 'include/**' | ||
- 'testsuite/**' | ||
|
||
env: | ||
BUILD_TYPE: Debug | ||
|
||
jobs: | ||
upload-coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure CMake | ||
shell: bash | ||
working-directory: ${{runner.workspace}} | ||
run: > | ||
cmake -H${{github.event.repository.name}} -Bbuild | ||
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" | ||
-DENABLE_COVERAGE=true | ||
-G"Unix Makefiles" | ||
- name: Build with coverage | ||
shell: bash | ||
working-directory: ${{runner.workspace}}/build | ||
run: cmake --build . --config $BUILD_TYPE -j 2 | ||
|
||
- name: Run the test suite | ||
shell: bash | ||
working-directory: ${{runner.workspace}}/build | ||
run: ctest -C Release --output-on-failure | ||
|
||
- name: Create coverage info | ||
shell: bash | ||
working-directory: ${{runner.workspace}}/build | ||
run: make gcov | ||
|
||
- name: Upload coverage info | ||
shell: bash | ||
working-directory: ${{runner.workspace}}/build | ||
run: bash <(curl -s https://codecov.io/bash) -X gcov || echo "Codecov did not collect coverage reports"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters