@@ -3,7 +3,8 @@ name: fpm-deployment
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- test :
6
+ deploy :
7
+ name : Run tests and deploys the fpm branches
7
8
runs-on : ${{ matrix.os }}
8
9
strategy :
9
10
fail-fast : false
@@ -45,18 +46,69 @@ jobs:
45
46
python config/fypp_deployment.py --with_xdp --with_qp
46
47
fpm test --profile release --flag '-DWITH_XDP -DWITH_QP'
47
48
48
- # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch.
49
+ # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch.
49
50
- name : Deploy 🚀
50
51
51
52
if : github.event_name != 'pull_request'
52
53
with :
53
54
BRANCH : stdlib-fpm
54
55
FOLDER : stdlib-fpm
55
56
56
- # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64` branch.
57
+ # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64` branch.
57
58
- name : Deploy with 64-bit integer support 🚀
58
59
59
60
if : github.event_name != 'pull_request'
60
61
with :
61
62
BRANCH : stdlib-fpm-ilp64
62
63
FOLDER : stdlib-fpm-ilp64
64
+
65
+ coverage :
66
+ name : Generate and upload code coverage report
67
+ needs : deploy
68
+ if : github.ref == 'refs/heads/stdlib-fpm'
69
+ runs-on : ${{ matrix.os }}
70
+ strategy :
71
+ fail-fast : false
72
+ matrix :
73
+ include :
74
+ - os : ubuntu-latest
75
+ toolchain : {compiler: gcc, version: 13}
76
+
77
+ steps :
78
+ - name : Checkout code
79
+
80
+
81
+ - uses : fortran-lang/setup-fortran@main
82
+ id : setup-fortran
83
+ with :
84
+ compiler : ${{ matrix.toolchain.compiler }}
85
+ version : ${{ matrix.toolchain.version }}
86
+
87
+ - name : Setup Fortran Package Manager
88
+ uses : fortran-lang/setup-fpm@v5
89
+ with :
90
+ fpm-version : ' v0.10.0'
91
+
92
+ - name : Prepare for code coverage
93
+ if : contains( matrix.os, 'ubuntu')
94
+ run : |
95
+ sudo apt-get install lcov
96
+
97
+ - name : Run tests to generate the coverage.
98
+ run : fpm test --profile release --flag '-DWITH_XDP -DWITH_QP -coverage'
99
+
100
+ - name : Create coverage report
101
+ run : |
102
+ mkdir -p ${{ env.COV_DIR }}
103
+ mv ./build/gfortran_*/*/* ${{ env.COV_DIR }}
104
+ lcov --capture --initial --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.base --ignore-errors mismatch
105
+ lcov --capture --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.capture --ignore-errors mismatch
106
+ lcov --add-tracefile ${{ env.COV_DIR }}/coverage.base --add-tracefile ${{ env.COV_DIR }}/coverage.capture --output-file ${{ env.COV_DIR }}/coverage.info --ignore-errors mismatch
107
+ env :
108
+ COV_DIR : build/coverage
109
+
110
+ - name : Upload coverage report
111
+ uses : codecov/codecov-action@v4
112
+ with :
113
+ token : ${{ secrets.CODECOV_TOKEN }}
114
+ files : build/coverage/coverage.info
0 commit comments