Skip to content

Commit 33c41ec

Browse files
committed
ci:linux: add coverage report HTML
1 parent 496cadb commit 33c41ec

File tree

6 files changed

+759
-7
lines changed

6 files changed

+759
-7
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,30 @@ jobs:
116116
run: ctest --test-dir Examples/build -V
117117

118118

119+
linux-coverage:
120+
runs-on: ubuntu-latest
121+
timeout-minutes: 10
122+
123+
steps:
124+
- uses: actions/checkout@v2
125+
126+
- name: install hdf5
127+
run: |
128+
sudo apt update -yq
129+
sudo apt install -yq --no-install-recommends libhdf5-dev
130+
131+
- run: cmake --preset coverage
132+
- run: cmake --build --preset coverage
133+
134+
- name: Code coverage
135+
run: cmake --build --preset run-coverage
136+
137+
- uses: actions/upload-artifact@v2
138+
with:
139+
name: coverage-report-html
140+
path: build/coverage/
141+
142+
119143
linux-build-static:
120144
needs: linux-static
121145
runs-on: ubuntu-latest

.github/workflows/ci_macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ jobs:
5050

5151
- name: Upload artifact
5252
if: github.event.action == 'published'
53-
uses: actions/upload-artifact@v1
53+
uses: actions/upload-artifact@v2
5454
with:
5555
name: binary-archive
56-
path: build/package
56+
path: build/package/
5757

5858
- name: get version
5959
if: github.event.action == 'published'

.github/workflows/ci_windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ jobs:
7676

7777
- name: Upload artifact
7878
if: github.event.action == 'published'
79-
uses: actions/upload-artifact@v1
79+
uses: actions/upload-artifact@v2
8080
with:
8181
name: binary-archive
82-
path: build/package
82+
path: build/package/
8383

8484
- name: get version
8585
if: github.event.action == 'published'

CMakePresets.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@
1313
"displayName": "build all libraries",
1414
"description": "Build all external libraries without searching for existing libraries.",
1515
"cacheVariables": {
16-
"hdf5_external": "on"
16+
"hdf5_external": true
17+
}
18+
},
19+
{
20+
"name": "coverage",
21+
"binaryDir": "${sourceDir}/build-coverage",
22+
"displayName": "Code Coverage",
23+
"description": "Build with code coverage enabled.",
24+
"cacheVariables": {
25+
"CMAKE_BUILD_TYPE": "Debug",
26+
"ENABLE_COVERAGE": true,
27+
"autobuild": false
1728
}
1829
},
1930
{
@@ -35,6 +46,15 @@
3546
"name": "debug",
3647
"configurePreset": "multi",
3748
"configuration": "Debug"
49+
},
50+
{
51+
"name": "coverage",
52+
"configurePreset": "coverage"
53+
},
54+
{
55+
"name": "run-coverage",
56+
"configurePreset": "coverage",
57+
"targets": "coverage"
3858
}
3959
],
4060
"testPresets": [

0 commit comments

Comments
 (0)