Skip to content

Commit

Permalink
Merge pull request mom-ocean#21 from marshallward/new_codecov_uploader
Browse files Browse the repository at this point in the history
Testing: Codecov uploader update
  • Loading branch information
Hallberg-NOAA authored Dec 6, 2021
2 parents ad35e4a + 7d80abc commit 7e1474e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ endif
# These are set to true by our Travis configuration if testing a pull request
DO_REGRESSION_TESTS ?=
REPORT_COVERAGE ?=
CODECOV_UPLOADER_URL ?= https://uploader.codecov.io/latest/linux/codecov

ifeq ($(DO_REGRESSION_TESTS), true)
BUILDS += target
Expand All @@ -165,6 +166,7 @@ else
endif



# List of source files to link this Makefile's dependencies to model Makefiles
# Assumes a depth of two, and the following extensions: F90 inc c h
# (1): Root directory
Expand Down Expand Up @@ -542,6 +544,7 @@ $(foreach c,$(CONFIGS),$(eval $(call CONFIG_DIM_RULE,$(c))))
# $(4): MOM_override configuration
# $(5): Environment variables
# $(6): Number of MPI ranks

define STAT_RULE
work/%/$(1)/ocean.stats work/%/$(1)/chksum_diag: build/$(2)/MOM6 $(VENV_PATH)
@echo "Running test $$*.$(1)..."
Expand Down Expand Up @@ -570,10 +573,13 @@ work/%/$(1)/ocean.stats work/%/$(1)/chksum_diag: build/$(2)/MOM6 $(VENV_PATH)
@echo -e "$(DONE): $$*.$(1); no runtime errors."
if [ $(3) ]; then \
mkdir -p results/$$* ; \
cd build/symmetric \
&& bash <(curl -s https://codecov.io/bash) -Z -n $$@ \
> codecov.$$*.$(1).out \
2> codecov.$$*.$(1).err \
cd build/symmetric ; \
gcov *.gcda > gcov.$$*.$(1).out ; \
curl -s $(CODECOV_UPLOADER_URL) -o codecov ; \
chmod +x codecov ; \
./codecov -Z -f "*.gcov" -n $$@ \
> codecov.$$*.$(1).out \
2> codecov.$$*.$(1).err \
&& echo -e "${MAGENTA}Report uploaded to codecov.${RESET}"; \
fi
endef
Expand Down

0 comments on commit 7e1474e

Please sign in to comment.