1010 build : [fpm, meson]
1111 os : [ubuntu-latest, macos-latest, windows-latest]
1212 gcc : [10] # Version of GFortran we want to use.
13+ build-type : [debug]
14+ include :
15+ - build : meson
16+ os : ubuntu-latest
17+ gcc : 10
18+ build-type : coverage
19+
1320 defaults :
1421 run :
1522 shell : ${{ contains(matrix.os, 'windows') && 'powershell' || 'bash -l {0}' }}
6168 uses : mamba-org/provision-with-micromamba@main
6269 with :
6370 environment-file : config/ci/${{ matrix.build }}-env.yaml
71+ extra-specs : |
72+ ${{ matrix.build-type == 'coverage' && 'gcovr' || '' }}
6473
6574 - name : Compile (fpm)
6675 if : ${{ matrix.build == 'fpm' }}
@@ -80,14 +89,17 @@ jobs:
8089 meson setup _build
8190 --libdir=lib
8291 --prefix=${{ contains(matrix.os, 'windows') && '$pwd\_dist' || '$PWD/_dist' }}
92+ ${{ matrix.build-type == 'coverage' && '-Db_coverage=true' || '' }}
8393
8494 - name : Compile project (meson)
8595 if : ${{ matrix.build == 'meson' }}
8696 run : meson compile -C _build
8797
8898 - name : Run testsuite (meson)
8999 if : ${{ matrix.build == 'meson' }}
90- run : meson test -C _build --no-rebuild --print-errorlogs
100+ run : |
101+ meson test -C _build --no-rebuild --print-errorlogs
102+ ${{ matrix.build-type == 'coverage' && 'ninja -C _build coverage' || '' }}
91103
92104 - name : Install project (meson)
93105 if : ${{ matrix.build == 'meson' }}
@@ -112,12 +124,16 @@ jobs:
112124 OUTPUT : minpack-${{ matrix.os }}.tar
113125
114126 - name : Upload package
115- if : ${{ matrix.build == 'meson' }}
127+ if : ${{ matrix.build == 'meson' && matrix.build-type != 'coverage' }}
116128 uses : actions/upload-artifact@v2
117129 with :
118130 name : ${{ env.MINPACK_OUTPUT }}
119131 path : ${{ env.MINPACK_OUTPUT }}
120132
133+ - name : Upload coverage report
134+ if : ${{ matrix.build-type == 'coverage' }}
135+ uses : codecov/codecov-action@v2
136+
121137
122138 Python :
123139 needs :
@@ -232,6 +248,9 @@ jobs:
232248 LD_LIBRARY_PATH : ${{ env.LD_LIBRARY_PATH }}:${{ env.MINPACK_PREFIX }}/lib
233249 DYLD_LIBRARY_PATH : ${{ env.DYLD_LIBRARY_PATH }}:${{ env.MINPACK_PREFIX }}/lib
234250
251+ - name : Upload coverage report
252+ uses : codecov/codecov-action@v2
253+
235254
236255 Docs :
237256 runs-on : ubuntu-latest
0 commit comments