Browse Source

make: Add target to check generated/derived files were checked in

A new target `check-gen-updated` to verify that all derived/generated
files that were modified were also checked in. This is used on CI to
check, and is not added to `check` since it'll complain on dirty
trees, i.e., before the devs check in their changes.

Suggested-by: Rusty Russell <@rustyrussell>
master
Christian Decker 4 years ago
parent
commit
927eda065b
  1. 4
      .github/workflows/ci.yaml
  2. 12
      Makefile

4
.github/workflows/ci.yaml

@ -16,9 +16,9 @@ jobs:
include: include:
# CFG us just an enumeration so we can refer to the configurations more easily # CFG us just an enumeration so we can refer to the configurations more easily
- {CFG: 1, TEST_CMD: "make", NO_PYTHON: 1} - {CFG: 1, TEST_CMD: "make", NO_PYTHON: 1}
- {CFG: 2, TEST_CMD: "make check-source check-units installcheck", COPTFLAGS: "-O3"} - {CFG: 2, TEST_CMD: "make check-source check-units installcheck check-gen-updated", COPTFLAGS: "-O3"}
- {CFG: 3, ARCH: 32, TEST_CMD: "make check-source check-units installcheck", DEVELOPER: 0} - {CFG: 3, ARCH: 32, TEST_CMD: "make check-source check-units installcheck", DEVELOPER: 0}
- {CFG: 4, TEST_CMD: "make check-source check-units installcheck", EXPERIMENTAL_FEATURES: 1} - {CFG: 4, TEST_CMD: "make check-source check-units installcheck check-gen-updated", EXPERIMENTAL_FEATURES: 1}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.0.0 uses: actions/checkout@v2.0.0

12
Makefile

@ -485,6 +485,18 @@ check-source: check-makefile check-source-bolt check-whitespace check-markdown c
full-check: check check-source full-check: check check-source
# Simple target to be used on CI systems to check that all the derived
# files were checked in and updated. It depends on the generated
# targets, and checks if any of the tracked files changed. If they did
# then one of the gen-targets caused this change, meaning either the
# gen-target is not reproducible or the files were forgotten.
#
# Do not run on your development tree since it will complain if you
# have a dirty tree.
check-gen-updated: $(ALL_GEN_HEADERS) $(ALL_GEN_SOURCES) wallet/statements_gettextgen.po $(MANPAGES)
@echo "Checking for generated files being changed by make"
git diff --exit-code HEAD $?
coverage/coverage.info: check pytest coverage/coverage.info: check pytest
mkdir coverage || true mkdir coverage || true
lcov --capture --directory . --output-file coverage/coverage.info lcov --capture --directory . --output-file coverage/coverage.info

Loading…
Cancel
Save