1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-20 11:54:48 +00:00

Add build steps to check the committed files against "make clean".

If "make clean" on a new checkout causes diffs, you accidentally committed
one of the build products currently listed in "make clean", and you
should `git rm` it again.

If "make clean" on a dirty/built checkout causes diffs, then either
(1) the "make" process modified some tracked file which is not removed
by "make clean", i.e. either (1A) it is a build product which needs to
be `git rm`ed AND added under "make clean", or (1B) the build process
is modifying some source file, which is highly weird and shouldn't happen;
or else (2) "make" created some untracked file which is not removed
by "make clean", i.e., you should add that build product to "make clean".

The Travis build that uses "mymake" now does the same "mv" trick as Github CI,
to avoid having the executable sometimes named "./hyperrogue" and sometimes
named "./hyper". Why are these filenames different, anyway?
This commit is contained in:
Arthur O'Dwyer 2020-09-30 09:35:11 -04:00
parent 0fd92b6c37
commit 3a29576d9f
2 changed files with 18 additions and 2 deletions

View File

@ -177,6 +177,12 @@ before_install:
fi
script:
- |-
make -f Makefile.simple clean
if [[ "$(git status --porcelain)" ]]; then
git status
exit 'A build artifact was committed; git rm it and try again'
fi
- |-
# Build hyperrogue.
if [[ "$TRAVIS_BUILD_SYSTEM" == "autotools" ]]; then
@ -192,6 +198,7 @@ script:
else
./mymake
fi
mv hyper hyperrogue
elif [[ "$TRAVIS_BUILD_SYSTEM" == "emscripten" ]]; then
docker run --rm -v $(pwd):/src trzeci/emscripten make -f Makefile.simple emscripten
else
@ -201,11 +208,19 @@ script:
# Test hyperrogue.
if [[ "$TRAVIS_BUILD_SYSTEM" == "emscripten" ]]; then
ls -lAF hyper.html hyper.js hyper.wasm
elif [[ "$TRAVIS_BUILD_SYSTEM" == "mymake" ]]; then
./hyper --help
else
./hyperrogue --help
fi
- |-
if [[ "$TRAVIS_BUILD_SYSTEM" == "autotools" ]]; then
make clean
else
make -f Makefile.simple clean
fi
if [[ "$(git status --porcelain)" ]]; then
git status
exit 'make clean did not return the repository to its pre-build state'
fi
- |-
# Test "make dist". ("make distcheck" is expected to fail.)
if [[ "$TRAVIS_BUILD_SYSTEM" == "autotools" ]]; then make dist; fi

View File

@ -21,6 +21,7 @@ langen_SOURCES = langen.cpp
langen_CXXFLAGS = -O0 -std=c++11 ${AM_CXXFLAGS}
makeh_SOURCES = makeh.cpp
BUILT_SOURCES = language-data.cpp autohdr.h
CLEANFILES = language-data.cpp autohdr.h
language-data.cpp: langen
./langen > language-data.cpp