Add BaseObject and BaseArray classes #365
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: [ '**' ] | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.txt' | |
jobs: | |
coverage-linux: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
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: | | |
mkdir build | |
conan install . -of build --build=missing -s compiler.cppstd=20 | |
cmake . -B build -DSIMFIL_WITH_COVERAGE=YES -DSIMFIL_WITH_TESTS=YES -DCMAKE_BUILD_TYPE=Debug -DSIMFIL_FPIC=YES -DSIMFIL_SHARED=NO -DSIMFIL_WITH_COVERAGE=YES -GNinja | |
cmake --build build | |
- name: Run CTest | |
working-directory: build/test | |
run: | | |
ctest --verbose --output-junit result-junit.xml | |
- 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/ | |
less coverage.xml | |
- 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 |