Use + Provide Conan Packages #168
Workflow file for this run
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
name: Coverage | |
on: | |
push: | |
branches: [ master, main ] | |
pull_request: | |
branches: [ '**' ] | |
jobs: | |
coverage-linux: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: | | |
sudo apt-get install ninja-build | |
pip install gcovr | |
gcovr --version | |
- name: Install Conan 2 | |
run: | | |
pip install conan | |
conan profile detect | |
- name: Build | |
run: | | |
conan build . -o with_tests=True -o with_coverage=True --settings=build_type=RelWithDebInfo --build=missing | |
- name: Run CTest | |
run: | | |
ctest --verbose --output-junit result-junit.xml --preset conan-relwithdebinfo | |
- name: Run Gcovr | |
run: | | |
mkdir coverage | |
gcovr --html-details coverage/coverage.html \ | |
--filter src/ --filter include/ | |
gcovr --cobertura coverage.xml \ | |
--html coverage.html \ | |
--filter src/ --filter include/ | |
- name: Publish Coverage HTML | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test Coverage | |
path: coverage | |
- name: Upload coverage HTML to Gist | |
# Upload only for main branch | |
if: > | |
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || | |
github.event_name != 'workflow_run' && github.ref == 'refs/heads/main' | |
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d | |
with: | |
token: ${{ secrets.GIST_TOKEN }} | |
gistURL: https://gist.githubusercontent.com/johannes-wolf/61e57af50757b03e0c7cd119ec2d2f4b | |
file: coverage.html | |
- name: Code Coverage Report | |
uses: irongut/[email protected] | |
with: | |
filename: coverage.xml | |
badge: false | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '50 80' | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
recreate: true | |
path: code-coverage-results.md |