Skip to content

Commit

Permalink
GHA: Use CODECOV_TOKEN to reduce failed uploads (#170)
Browse files Browse the repository at this point in the history
* Do not fail CI if Codecov upload fails
* Decrease number of required builds for Codecov PR post
  • Loading branch information
danielhollas authored Jan 15, 2024
1 parent f25a007 commit 443b0d3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/gfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ 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,
# so for now we let the CI succeed even if the upload fails.
# Reported by many people also at:
# https://github.com/codecov/codecov-action/issues/926
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

jobs:

Expand Down Expand Up @@ -100,6 +111,7 @@ jobs:
name: ${{env.CODECOV_NAME}}
flags: unittests
gcov: true
fail_ci_if_error: false

- name: Run End-to-End tests
if: always()
Expand All @@ -109,7 +121,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
fail_ci_if_error: false
gcov: true

intel_build:
Expand Down Expand Up @@ -193,7 +205,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: tcpb
fail_ci_if_error: true
fail_ci_if_error: false
gcov: true


Expand Down Expand Up @@ -292,7 +304,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
fail_ci_if_error: false
gcov: true

mpich_build:
Expand Down Expand Up @@ -361,7 +373,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
fail_ci_if_error: false
gcov: true

openmpi_build:
Expand Down Expand Up @@ -404,7 +416,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
fail_ci_if_error: false
gcov: true

plumed_build:
Expand Down Expand Up @@ -475,5 +487,5 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
fail_ci_if_error: false
gcov: true
5 changes: 4 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ codecov:
# are completed, otherwise we'll temporarily receive
# incomplete coverage reports.
# Note that unit test coverage builds count towards the build count!
after_n_builds: 18
# NOTE: Due to Codecov upload issues, we've decreased the number of builds
# from 18 to 6 (hopefully temporarily). Perhaps we can revisit
# when codecov-action@v4 is released.
after_n_builds: 6
wait_for_ci: yes

coverage:
Expand Down

0 comments on commit 443b0d3

Please sign in to comment.