Skip to content

Commit

Permalink
Refactoring of the .testing Makefile
Browse files Browse the repository at this point in the history
Primarily changes to improve coverage reporting, but some other changes
as well:

* New separate rules for `codecov` and `report.cov`

* REPORT_COVERAGE was split into two flags:
  * DO_COVERAGE: Enable code coverage reporting
  * REQUIRE_COVERAGE_UPLOAD: If true, error if upload fails

* We now report codecov upload failures in the log, but only raise an
  error (i.e. nonzero return code) if REQUIRE_COVERAGE_UPLOAD is true.

* GitHub Actions now only reports failed uploads to CodeCov for pull
  requests.

* Separate FCFLAGS_FMS flag to control FCFLAGS for FMS builds
  - also renamed the old FCFLAGS_FMS to FCFLAGS_DEPS, which was
    previously used to pass the flags to the FMS library/modfiles

* $(DEPS) was dropped, and we just use `deps` now.

* Updated the header instructions

* README update

* Codecov.io and GitHub Actions CIs were updated to support changes
  • Loading branch information
marshallward authored and adcroft committed Jul 29, 2022
1 parent a054c7a commit 9928d95
Show file tree
Hide file tree
Showing 5 changed files with 508 additions and 388 deletions.
4 changes: 0 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ coverage:
default:
threshold: 100%
base: parent
comment:
# This is set to the number of TCs, plus unit, but can be removed
# (i.e. set to 1) when reporting is separated from coverage.
after_n_builds: 9
30 changes: 23 additions & 7 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Code coverage
on: [push, pull_request]

jobs:
build-test-nans:
build-coverage:

runs-on: ubuntu-latest
defaults:
run:
working-directory: .testing

env:
REPORT_COVERAGE: true
#env:
# REQUIRE_COVERAGE_UPLOAD: true

steps:
- uses: actions/checkout@v2
Expand All @@ -26,10 +26,26 @@ jobs:
run: make -j build/unit/MOM6

- name: Run unit tests
run: make unit.cov.upload
run: make run.cov.unit

- name: Compile MOM6 with code coverage
- name: Report unit test coverage to CI (PR)
if: github.event_name == 'pull_request'
run: make report.cov.unit REQUIRE_COVERAGE_UPLOAD=true

- name: Report unit test coverage to CI (Push)
if: github.event_name != 'pull_request'
run: make report.cov.unit

- name: Compile ocean-only MOM6 with code coverage
run: make -j build/cov/MOM6

- name: Run and post coverage
run: make run.cov -k -s
- name: Run coverage tests
run: make -j -k run.cov

- name: Report coverage to CI (PR)
if: github.event_name == 'pull_request'
run: make report.cov REQUIRE_COVERAGE_UPLOAD=true

- name: Report coverage to CI (Push)
if: github.event_name != 'pull_request'
run: make report.cov
Loading

0 comments on commit 9928d95

Please sign in to comment.