Skip to content

Commit 5623db1

Browse files
new try for coverage
1 parent 35ee435 commit 5623db1

2 files changed

Lines changed: 39 additions & 51 deletions

File tree

.github/workflows/build-coverage.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ on:
2323
- '!**Makefile'
2424
- '!**md'
2525

26-
permissions:
27-
contents: read
26+
#permissions:
27+
# contents: read
2828

2929
#env:
3030
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
@@ -101,8 +101,39 @@ jobs:
101101
coveralls-out: coveralls.json
102102
print-summary: true
103103
root: ${{github.workspace}}
104-
- name: send report
105-
uses: 5monkeys/cobertura-action@master
106-
with:
107-
path: cobertura.xml
108-
minimum_coverage: 45
104+
105+
- name: Produce the coverage report
106+
uses: insightsengineering/coverage-action@v3
107+
with:
108+
# Path to the Cobertura XML report.
109+
path: ./cobertura.xml
110+
# Minimum total coverage, if you want to the
111+
# workflow to enforce it as a standard.
112+
# This has no effect if the `fail` arg is set to `false`.
113+
threshold: 45.00
114+
# Fail the workflow if the minimum code coverage
115+
# reuqirements are not satisfied.
116+
fail: true
117+
# Publish the rendered output as a PR comment
118+
publish: true
119+
# Create a coverage diff report.
120+
diff: false
121+
# Branch to diff against.
122+
# Compare the current coverage to the coverage
123+
# determined on this branch.
124+
diff-branch: main
125+
# This is where the coverage reports for the
126+
# `diff-branch` are stored.
127+
# Branch is created if it doesn't already exist'.
128+
diff-storage: _xml_coverage_reports
129+
# A custom title that can be added to the code
130+
# coverage summary in the PR comment.
131+
coverage-summary-title: "Code Coverage Summary"
132+
# Failure modes for coverage regression detection:
133+
# Fail if any changed file has more uncovered lines (pycobertura exit code 2)
134+
uncovered-statements-increase-failure: false
135+
# Fail if new uncovered statements are introduced despite overall improvement (pycobertura exit code 3)
136+
new-uncovered-statements-failure: false
137+
# Fail if the overall coverage percentage decreases (more forgiving approach)
138+
coverage-rate-reduction-failure: true
139+

.github/workflows/build-unix.yml

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -116,50 +116,7 @@ jobs:
116116
- name: Install
117117
run: cmake --build build --target install -j2
118118

119-
coverage:
120-
runs-on: ubuntu-latest
121-
env:
122-
BUILD_TYPE: Coverage
123-
FFLAGS: "-fopenmp"
124-
steps:
125-
126-
- name: Checkout SLICOT
127-
uses: actions/checkout@v4.2.2
128-
129-
- name: Install ninja-build tool
130-
uses: seanmiddleditch/gha-setup-ninja@v6
131-
132-
- name: Install basics
133-
run: |
134-
sudo apt update
135-
sudo apt install -y cmake liblapack-dev libblas-dev
136-
137-
138-
- name: Configure CMake
139-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
140-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
141-
run: >
142-
cmake -B build -G Ninja
143-
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
144-
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install
145-
-D SLICOT_BUILD_TESTING:BOOL=ON
146-
-D SLICOT_BUILD_SHARED_LIBS:BOOL=ON
147-
148-
- name: Build
149-
# Execute tests defined by the CMake configuration.
150-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
151-
run: cmake --build build --config ${{env.BUILD_TYPE}}
152-
153-
- name: Test with OpenMP
154-
working-directory: ${{github.workspace}}/build
155-
run: ctest -C ${{env.BUILD_TYPE}} --schedule-random -j1 --output-on-failure --timeout 100
156-
157-
- name: Generate HTML Report
158-
uses: threeal/gcovr-action@v1.1.0
159-
with:
160-
html-out: coverage.html
161-
162-
# memory-check:
119+
# memory-check:
163120
# runs-on: ubuntu-latest
164121
# env:
165122
# BUILD_TYPE: Debug

0 commit comments

Comments
 (0)