Skip to content

Commit 6cec323

Browse files
committed
Try running the code-coverage from the stdlib-fpm branch.
1 parent 601fe74 commit 6cec323

File tree

2 files changed

+55
-65
lines changed

2 files changed

+55
-65
lines changed

.github/workflows/codecov.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/fpm-deployment.yml

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ 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
@@ -45,18 +46,69 @@ jobs:
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/[email protected]
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/[email protected]
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+
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+
uses: actions/[email protected]
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

Comments
 (0)