@@ -3,14 +3,15 @@ name: fpm-deployment
33on : [push, pull_request]
44
55jobs :
6- test :
6+ deploy :
7+ name : Run tests and deploys the fpm branches
78 runs-on : ${{ matrix.os }}
89 strategy :
910 fail-fast : false
1011 matrix :
1112 include :
1213 - os : ubuntu-latest
13- toolchain : {compiler: gcc, version: 13 }
14+ toolchain : {compiler: gcc, version: '13' }
1415
1516 steps :
1617 - name : Checkout code
@@ -31,32 +32,84 @@ jobs:
3132 version : ${{ matrix.toolchain.version }}
3233
3334 - name : Setup Fortran Package Manager
34- uses : fortran-lang/setup-fpm@v5
35+ uses : fortran-lang/setup-fpm@v8
3536 with :
36- fpm-version : ' v0.10.0 '
37+ fpm-version : v0.12.0
3738
3839 - run : | # Just for deployment: create stdlib-fpm folder
3940 python config/fypp_deployment.py --deploy_stdlib_fpm
4041
4142 - run : | # Just for deployment: create stdlib-fpm-ilp64 folder
4243 python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64
4344
44- - run : | # Use fpm gnu ci to check xdp and qp
45+ - run : | # Use fpm gnu ci to check xdp and qp
4546 python config/fypp_deployment.py --with_xdp --with_qp
4647 fpm test --profile release --flag '-DWITH_XDP -DWITH_QP'
4748
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.
4950 - name : Deploy π
5051 uses : JamesIves/github-pages-deploy-action@4.1.5
5152 if : github.event_name != 'pull_request'
5253 with :
5354 BRANCH : stdlib-fpm
5455 FOLDER : stdlib-fpm
5556
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.
5758 - name : Deploy with 64-bit integer support π
5859 uses : JamesIves/github-pages-deploy-action@4.1.5
5960 if : github.event_name != 'pull_request'
6061 with :
6162 BRANCH : stdlib-fpm-ilp64
6263 FOLDER : stdlib-fpm-ilp64
64+ 65+ coverage :
66+ name : Generate and upload code coverage report
67+ needs : deploy
68+ runs-on : ${{ matrix.os }}
69+ strategy :
70+ fail-fast : false
71+ matrix :
72+ include :
73+ - os : ubuntu-latest
74+ toolchain : {compiler: gcc, version: '13' }
75+ 76+ steps :
77+ - name : Checkout code
78+ uses : actions/checkout@v4.2.2
79+ with :
80+ ref : stdlib-fpm
81+ 82+ - uses : fortran-lang/setup-fortran@main
83+ id : setup-fortran
84+ with :
85+ compiler : ${{ matrix.toolchain.compiler }}
86+ version : ${{ matrix.toolchain.version }}
87+ 88+ - name : Setup Fortran Package Manager
89+ uses : fortran-lang/setup-fpm@v8
90+ with :
91+ fpm-version : v0.12.0
92+ 93+ - name : Prepare for code coverage
94+ if : contains( matrix.os, 'ubuntu')
95+ run : |
96+ sudo apt-get install lcov
97+
98+ - name : Run tests to generate the coverage.
99+ run : fpm test --profile release --flag '-DWITH_XDP -DWITH_QP -coverage'
100+ 101+ - name : Create coverage report
102+ run : |
103+ mkdir -p ${{ env.COV_DIR }}
104+ mv ./build/gfortran_*/*/* ${{ env.COV_DIR }}
105+ lcov --capture --initial --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.base --ignore-errors mismatch
106+ lcov --capture --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.capture --ignore-errors mismatch
107+ 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
108+ env :
109+ COV_DIR : build/coverage
110+ 111+ - name : Upload coverage report
112+ uses : codecov/codecov-action@v4
113+ with :
114+ token : ${{ secrets.CODECOV_TOKEN }}
115+ files : build/coverage/coverage.info
0 commit comments