Skip to content

Commit

Permalink
Bump Codecov action to v4 (#172)
Browse files Browse the repository at this point in the history
* Remove gcov parameter
* Fail CI if error
* Update cache action
  • Loading branch information
danielhollas authored Feb 4, 2024
1 parent 3a978fe commit 541508c
Showing 1 changed file with 30 additions and 37 deletions.
67 changes: 30 additions & 37 deletions .github/workflows/gfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ env:
ABIN_FFLAGS: -O0 -fopenmp --coverage -fprofile-abs-path -ffpe-trap=invalid,zero,overflow,denormal -fimplicit-none -Wall -Wno-integer-division -Wno-maybe-uninitialized
ABIN_LDLIBS: --coverage
OPTIMIZED_FFLAGS: -O3 -fopenmp -fimplicit-none -Wall -Wno-integer-division
# Even for public builds, it is apparently useful to use CODECOV_TOKEN
# to minimize failed uploads, see:
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
# NOTE: This breaks CI on PRs from forks. We might need to change this if it becomes an issue.
# NOTE: It would be safer to only pass the secret token to the codecov-upload action,
# but the impact of this token leaking is small anyway.
# NOTE: It appears that even with this token there are issues,
Expand Down Expand Up @@ -85,11 +81,12 @@ jobs:
# pFUnit library is used to build and run unit tests
- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/pfunit/build/installed
# To force a pFUnit rebuild (bust the cache), make a change to install_pfunit.sh
key: ${{ runner.os }}-ubuntu20.04-pfunit-gfortran${{ env.GCC_V }}-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
save-always: true

- name: Download and build pFUnit
if: steps.pfunit-cache.outputs.cache-hit != 'true'
Expand All @@ -105,23 +102,21 @@ jobs:
run: make unittest

- name: Codecov upload unit tests
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
flags: unittests
gcov: true
fail_ci_if_error: false
fail_ci_if_error: true

- name: Run End-to-End tests
if: always()
run: make e2etest

- name: Codecov upload
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: false
gcov: true
fail_ci_if_error: true

intel_build:
name: Intel OneAPI build
Expand Down Expand Up @@ -181,7 +176,7 @@ jobs:

- name: TCBP build cache
id: tcpb-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/tcpb-cpp/lib
# To force a rebuild (bust the cache), make a change to install_tcpb.sh
Expand All @@ -201,11 +196,10 @@ jobs:
run: make e2etest

- name: Codecov upload
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: tcpb
fail_ci_if_error: false
gcov: true
fail_ci_if_error: true


optimized_build:
Expand Down Expand Up @@ -233,10 +227,11 @@ jobs:
- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/pfunit/build/installed
key: ${{ runner.os }}-ubuntu22.04-pfunit-gfortran${{ env.GCC_V }}-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
save-always: true

- name: Download and build pFUnit
if: steps.pfunit-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -271,10 +266,11 @@ jobs:

- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/pfunit/build/installed
key: ${{ runner.os }}-ubuntu22.04-pfunit-gfortran-default-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
save-always: true

- name: Download and build pFUnit
if: steps.pfunit-cache.outputs.cache-hit != 'true'
Expand All @@ -290,21 +286,19 @@ jobs:
run: make unittest

- name: Codecov upload unit tests
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
flags: unittests
gcov: true

- name: Run End-to-End tests
run: make e2etest

- name: Codecov upload
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: false
gcov: true
fail_ci_if_error: true

mpich_build:
name: MPICH build
Expand Down Expand Up @@ -341,10 +335,11 @@ jobs:
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: MPICH build Cache
id: mpich-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/mpich/${{ env.MPICH_V }}/install
key: ${{runner.os}}-ubuntu20.04-mpich${{ env.MPICH_V }}-gfortran${{ env.GCC_V }}-${{hashFiles('dev_scripts/install_mpich.sh')}}
save-always: true

- name: Build and Install MPICH
if: steps.mpich-cache.outputs.cache-hit != 'true'
Expand All @@ -369,11 +364,10 @@ jobs:
- name: test ABIN
run: make test
- name: Codecov upload
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: false
gcov: true
fail_ci_if_error: true

openmpi_build:
name: OpenMPI build
Expand All @@ -395,10 +389,11 @@ jobs:
fetch-depth: 2
- name: OpenMPI build cache
id: openmpi-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/openmpi/${{ env.OPENMPI_V }}/install
key: ${{runner.os}}-ubuntu20.04-openmpi${{ env.OPENMPI_V }}-gfortran-default-${{hashFiles('dev_scripts/install_openmpi.sh')}}
save-always: true

- name: Build and Install OpenMPI
if: steps.openmpi-cache.outputs.cache-hit != 'true'
Expand All @@ -412,11 +407,10 @@ jobs:
- name: test ABIN
run: make test
- name: Codecov upload
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: false
gcov: true
fail_ci_if_error: true

plumed_build:
name: PLUMED build
Expand All @@ -440,18 +434,19 @@ jobs:
fetch-depth: 2
- name: Plumed build cache
id: plumed-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/plumed/${{ env.PLUMED_V }}/install
key: ${{runner.os}}-ubuntu20.04-plumed${{env.PLUMED_V}}-gcc-default-${{hashFiles('dev_scripts/install_plumed.sh')}}
save-always: true

- name: Build and Install PLUMED
if: steps.plumed-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_plumed.sh ${HOME}/plumed ${PLUMED_V}

- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/pfunit/build/installed
key: ${{ runner.os }}-ubuntu20.04-pfunit-gfortran-default-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
Expand All @@ -473,18 +468,16 @@ jobs:
run: make unittest

- name: Codecov upload unit tests
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
flags: unittests
gcov: true

- name: Run End-to-End tests
run: make e2etest

- name: Codecov upload
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: false
gcov: true
fail_ci_if_error: true

0 comments on commit 541508c

Please sign in to comment.