Skip to content

Commit 593080f

Browse files
committed
Add recipe to validate a configuration file
1 parent af9162b commit 593080f

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

tools/make/lib/coverage-service/codecov.mk

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ NODE ?= node
88
CAT ?= cat
99
CAT_FLAGS ?=
1010

11-
# Define the path to the Codecov executable:
11+
# Define the path to the [Codecov][1] executable.
12+
#
13+
# [1]: https://github.com/codecov/codecov-bash
14+
1215
CODECOV ?= bash <(curl -s https://codecov.io/bash)
1316

1417
# Define the command-line options to be used when reporting coverage statistics:
@@ -21,6 +24,9 @@ ifdef COVERAGE_NAME
2124
CODECOV_FLAGS := $(CODECOV_FLAGS) -F $(COVERAGE_NAME)
2225
endif
2326

27+
# Define the path to the Codecov configuration file:
28+
CODECOV_CONF ?= $(ROOT)/.codecov.yml
29+
2430

2531
# TARGETS #
2632

@@ -30,7 +36,19 @@ endif
3036
#
3137
# [1]: https://codecov.io/
3238

33-
coverage-codecov:
39+
coverage-codecov: validate-codecov-configuration
3440
$(QUIET) $(CAT) $(CAT_FLAGS) $(LCOV_INFO) | $(CODECOV) $(CODECOV_FLAGS) || echo "Failed to upload coverage reports to Codecov. :("
3541

3642
.PHONY: coverage-codecov
43+
44+
45+
# Validate configuration.
46+
#
47+
# This target validates a Codecov configuration file.
48+
49+
validate-codecov-configuration:
50+
$(QUIET) curl --data-binary $(CODECOV_CONF) https://codecov.io/validate
51+
52+
.PHONY: validate-codecov-configuration
53+
54+

0 commit comments

Comments
 (0)