Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 731b777

Browse files
loiseaujcperazzjvdp1jalvesz
authored
Added code_coverage support. (#1039)
* Added code_coverage support. * Update .github/workflows/fpm-deployment.yml Co-authored-by: Federico Perini <federico.perini@gmail.com> * bump-up fpm version and setup-fpm version * Apply suggestions from code review * parametrize versions * revert parameter for gcc * revert parametrization --------- Co-authored-by: Federico Perini <federico.perini@gmail.com> Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com> Co-authored-by: jalvesz <jose.alves@transvalor.com>
1 parent 9e4c230 commit 731b777

File tree

1 file changed

+60
-7
lines changed

1 file changed

+60
-7
lines changed

β€Ž.github/workflows/fpm-deployment.ymlβ€Ž

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ name: fpm-deployment
33
on: [push, pull_request]
44

55
jobs:
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

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /