From a8544c153d8030ed7f3a1198e428d706301ca048 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Date: Tue, 7 Oct 2025 09:53:11 +0200 Subject: [PATCH 1/7] Added code_coverage support. --- .github/workflows/fpm-deployment.yml | 61 ++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fpm-deployment.yml b/.github/workflows/fpm-deployment.yml index ffcd392e1..226f7cae6 100644 --- a/.github/workflows/fpm-deployment.yml +++ b/.github/workflows/fpm-deployment.yml @@ -3,7 +3,8 @@ name: fpm-deployment on: [push, pull_request] jobs: - test: + deploy: + name: Run tests and deploys the fpm branches runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -41,11 +42,11 @@ jobs: - run: | # Just for deployment: create stdlib-fpm-ilp64 folder python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64 - - run: | # Use fpm gnu ci to check xdp and qp + - run: | # Use fpm gnu ci to check xdp and qp python config/fypp_deployment.py --with_xdp --with_qp fpm test --profile release --flag '-DWITH_XDP -DWITH_QP' - # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch. + # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch. - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@4.1.5 if: github.event_name != 'pull_request' @@ -53,10 +54,62 @@ jobs: BRANCH: stdlib-fpm FOLDER: stdlib-fpm - # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64` branch. + # Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64` branch. - name: Deploy with 64-bit integer support 🚀 uses: JamesIves/github-pages-deploy-action@4.1.5 if: github.event_name != 'pull_request' with: BRANCH: stdlib-fpm-ilp64 FOLDER: stdlib-fpm-ilp64 + + coverage: + name: Generate and upload code coverage report + needs: deploy + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + toolchain: {compiler: gcc, version: 13} + + steps: + - name: Checkout code + uses: actions/checkout@v4.2.2 + with: + ref: stdlib-fpm + + - uses: fortran-lang/setup-fortran@main + id: setup-fortran + with: + compiler: ${{ matrix.toolchain.compiler }} + version: ${{ matrix.toolchain.version }} + + - name: Setup Fortran Package Manager + uses: fortran-lang/setup-fpm@v5 + with: + fpm-version: 'v0.10.0' + + - name: Prepare for code coverage + if: contains( matrix.os, 'ubuntu') + run: | + sudo apt-get install lcov + + - name: Run tests to generate the coverage. + run: fpm test --profile release --flag '-DWITH_XDP -DWITH_QP -coverage' + + - name: Create coverage report + run: | + mkdir -p ${{ env.COV_DIR }} + mv ./build/gfortran_*/*/* ${{ env.COV_DIR }} + lcov --capture --initial --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.base --ignore-errors mismatch + lcov --capture --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.capture --ignore-errors mismatch + 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 + env: + COV_DIR: build/coverage + + - name: Upload coverage report + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: build/coverage/coverage.info From 91f136a1295cce8b71a021917e237556f0b46910 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Date: Tue, 7 Oct 2025 13:42:53 +0200 Subject: [PATCH 2/7] Update .github/workflows/fpm-deployment.yml Co-authored-by: Federico Perini --- .github/workflows/fpm-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fpm-deployment.yml b/.github/workflows/fpm-deployment.yml index 226f7cae6..52a81e56c 100644 --- a/.github/workflows/fpm-deployment.yml +++ b/.github/workflows/fpm-deployment.yml @@ -88,7 +88,7 @@ jobs: - name: Setup Fortran Package Manager uses: fortran-lang/setup-fpm@v5 with: - fpm-version: 'v0.10.0' + fpm-version: 'v0.12.0' - name: Prepare for code coverage if: contains( matrix.os, 'ubuntu') From 687e733a9c5bdcd75148f6df909334fbfa8f5ba0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Date: Wed, 8 Oct 2025 14:36:18 +0200 Subject: [PATCH 3/7] bump-up fpm version and setup-fpm version --- .github/workflows/fpm-deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fpm-deployment.yml b/.github/workflows/fpm-deployment.yml index 52a81e56c..ef059dbf8 100644 --- a/.github/workflows/fpm-deployment.yml +++ b/.github/workflows/fpm-deployment.yml @@ -32,9 +32,9 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Setup Fortran Package Manager - uses: fortran-lang/setup-fpm@v5 + uses: fortran-lang/setup-fpm@v7 with: - fpm-version: 'v0.10.0' + fpm-version: 'v0.12.0' - run: | # Just for deployment: create stdlib-fpm folder python config/fypp_deployment.py --deploy_stdlib_fpm From 542dd99d5471d1c87aa37496a57797588a5cb5c8 Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 17 Oct 2025 19:32:32 +0200 Subject: [PATCH 4/7] Apply suggestions from code review --- .github/workflows/fpm-deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fpm-deployment.yml b/.github/workflows/fpm-deployment.yml index ef059dbf8..c3d7f4cd5 100644 --- a/.github/workflows/fpm-deployment.yml +++ b/.github/workflows/fpm-deployment.yml @@ -32,7 +32,7 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Setup Fortran Package Manager - uses: fortran-lang/setup-fpm@v7 + uses: fortran-lang/setup-fpm@v8 with: fpm-version: 'v0.12.0' @@ -86,7 +86,7 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Setup Fortran Package Manager - uses: fortran-lang/setup-fpm@v5 + uses: fortran-lang/setup-fpm@v8 with: fpm-version: 'v0.12.0' From 98448a3b85ef6413ded133efab8de3d12bc8667a Mon Sep 17 00:00:00 2001 From: jalvesz Date: Fri, 17 Oct 2025 22:27:55 +0200 Subject: [PATCH 5/7] parametrize versions --- .github/workflows/fpm-deployment.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fpm-deployment.yml b/.github/workflows/fpm-deployment.yml index c3d7f4cd5..3b6216ca2 100644 --- a/.github/workflows/fpm-deployment.yml +++ b/.github/workflows/fpm-deployment.yml @@ -2,6 +2,11 @@ name: fpm-deployment on: [push, pull_request] +env: + FPM_VERSION: 'v0.12.0' # FPM version + SETUP_FPM_VERSION: 'v8' # setup-fpm action version + GNU_VERSION: '13' # GNU compiler toolchain major version + jobs: deploy: name: Run tests and deploys the fpm branches @@ -11,7 +16,7 @@ jobs: matrix: include: - os: ubuntu-latest - toolchain: {compiler: gcc, version: 13} + toolchain: {compiler: gcc, version: ${{ env.GNU_VERSION }} } steps: - name: Checkout code @@ -32,9 +37,9 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Setup Fortran Package Manager - uses: fortran-lang/setup-fpm@v8 + uses: fortran-lang/setup-fpm@${{ env.SETUP_FPM_VERSION }} with: - fpm-version: 'v0.12.0' + fpm-version: ${{ env.FPM_VERSION }} - run: | # Just for deployment: create stdlib-fpm folder python config/fypp_deployment.py --deploy_stdlib_fpm @@ -71,7 +76,7 @@ jobs: matrix: include: - os: ubuntu-latest - toolchain: {compiler: gcc, version: 13} + toolchain: {compiler: gcc, version: ${{ env.GNU_VERSION }} } steps: - name: Checkout code @@ -86,9 +91,9 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Setup Fortran Package Manager - uses: fortran-lang/setup-fpm@v8 + uses: fortran-lang/setup-fpm@${{ env.SETUP_FPM_VERSION }} with: - fpm-version: 'v0.12.0' + fpm-version: ${{ env.FPM_VERSION }} - name: Prepare for code coverage if: contains( matrix.os, 'ubuntu') From 191614c73e484e723f60f2e1806882afd88d8966 Mon Sep 17 00:00:00 2001 From: jalvesz Date: Fri, 17 Oct 2025 22:35:39 +0200 Subject: [PATCH 6/7] revert parameter for gcc --- .github/workflows/fpm-deployment.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fpm-deployment.yml b/.github/workflows/fpm-deployment.yml index 3b6216ca2..5baf7b84e 100644 --- a/.github/workflows/fpm-deployment.yml +++ b/.github/workflows/fpm-deployment.yml @@ -5,7 +5,6 @@ on: [push, pull_request] env: FPM_VERSION: 'v0.12.0' # FPM version SETUP_FPM_VERSION: 'v8' # setup-fpm action version - GNU_VERSION: '13' # GNU compiler toolchain major version jobs: deploy: @@ -16,7 +15,7 @@ jobs: matrix: include: - os: ubuntu-latest - toolchain: {compiler: gcc, version: ${{ env.GNU_VERSION }} } + toolchain: {compiler: gcc, version: '13' } steps: - name: Checkout code @@ -76,7 +75,7 @@ jobs: matrix: include: - os: ubuntu-latest - toolchain: {compiler: gcc, version: ${{ env.GNU_VERSION }} } + toolchain: {compiler: gcc, version: '13' } steps: - name: Checkout code From adaee3406bc980dba62405b387963dc3265ac2d4 Mon Sep 17 00:00:00 2001 From: jalvesz Date: Fri, 17 Oct 2025 22:40:18 +0200 Subject: [PATCH 7/7] revert parametrization --- .github/workflows/fpm-deployment.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fpm-deployment.yml b/.github/workflows/fpm-deployment.yml index 5baf7b84e..51205a685 100644 --- a/.github/workflows/fpm-deployment.yml +++ b/.github/workflows/fpm-deployment.yml @@ -2,10 +2,6 @@ name: fpm-deployment on: [push, pull_request] -env: - FPM_VERSION: 'v0.12.0' # FPM version - SETUP_FPM_VERSION: 'v8' # setup-fpm action version - jobs: deploy: name: Run tests and deploys the fpm branches @@ -36,9 +32,9 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Setup Fortran Package Manager - uses: fortran-lang/setup-fpm@${{ env.SETUP_FPM_VERSION }} + uses: fortran-lang/setup-fpm@v8 with: - fpm-version: ${{ env.FPM_VERSION }} + fpm-version: v0.12.0 - run: | # Just for deployment: create stdlib-fpm folder python config/fypp_deployment.py --deploy_stdlib_fpm @@ -90,9 +86,9 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Setup Fortran Package Manager - uses: fortran-lang/setup-fpm@${{ env.SETUP_FPM_VERSION }} + uses: fortran-lang/setup-fpm@v8 with: - fpm-version: ${{ env.FPM_VERSION }} + fpm-version: v0.12.0 - name: Prepare for code coverage if: contains( matrix.os, 'ubuntu')