@@ -35,15 +35,43 @@ jobs:
35
35
with :
36
36
fpm-version : ' v0.10.0'
37
37
38
+ - name : Prepare for code coverage
39
+ if : contains( matrix.os, 'ubuntu')
40
+ run : |
41
+ sudo apt-get install lcov
42
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
43
+ sudo apt-get update
44
+ sudo apt-get install -y gcc-13 gfortran-13
45
+ sudo update-alternatives \
46
+ --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 \
47
+ --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-13 \
48
+ --slave /usr/bin/gcov gcov /usr/bin/gcov-13
49
+
38
50
- run : | # Just for deployment: create stdlib-fpm folder
39
51
python config/fypp_deployment.py --deploy_stdlib_fpm
40
52
41
53
- run : | # Just for deployment: create stdlib-fpm-ilp64 folder
42
54
python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64
43
55
44
- - run : | # Use fpm gnu ci to check xdp and qp
56
+ - run : | # Use fpm gnu ci to check xdp and qp
45
57
python config/fypp_deployment.py --with_xdp --with_qp
46
- fpm test --profile release --flag '-DWITH_XDP -DWITH_QP'
58
+ fpm test --profile release --flag '-DWITH_XDP -DWITH_QP -coverage'
59
+
60
+ - name : Create coverage report
61
+ run : |
62
+ mkdir -p ${{ env.COV_DIR }}
63
+ mv ./build/gfortran_*/*/* ${{ env.COV_DIR }}
64
+ lcov --capture --initial --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.base
65
+ lcov --capture --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.capture
66
+ lcov --add-tracefile ${{ env.COV_DIR }}/coverage.base --add-tracefile ${{ env.COV_DIR }}/coverage.capture --output-file ${{ env.COV_DIR }}/coverage.info
67
+ env :
68
+ COV_DIR : build/coverage
69
+
70
+ - name : Upload coverage report
71
+ uses : codecov/codecov-action@v4
72
+ with :
73
+ token : ${{ secrets.CODECOV_TOKEN }}
74
+ files : build/coverage/coverage.info
47
75
48
76
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch.
49
77
- name : Deploy 🚀
0 commit comments