Make dangling theories break the build.

This commit is contained in:
Achim D. Brucker 2023-03-02 00:23:23 +00:00
parent 53867fb24f
commit daea6333f1
3 changed files with 24 additions and 9 deletions

View File

@ -2,7 +2,7 @@ pipeline:
build:
image: docker.io/logicalhacking/isabelle2022
commands:
- ./.woodpecker/check_dangeling_theories
- ./.woodpecker/check_dangling_theories
- ./.woodpecker/check_external_file_refs
- export ARTIFACT_DIR=$CI_WORKSPACE/.artifacts/$CI_REPO/$CI_BRANCH/$CI_BUILD_NUMBER/$LATEX
- mkdir -p $ARTIFACT_DIR

View File

@ -1,8 +0,0 @@
#!/bin/bash
PWD=`pwd`
TMPDIR=`mktemp -d`
isabelle build -D . -l -n | grep $PWD | sed -e "s| *${PWD}/||" | sort -u | grep thy$ > ${TMPDIR}/sessions-thy-files.txt
find * -type f | sort -u | grep thy$ > ${TMPDIR}/actual-thy-files.txt
echo "Theories that are not part of a Isabelle session:"
echo "================================================="
comm -13 ${TMPDIR}/sessions-thy-files.txt ${TMPDIR}/actual-thy-files.txt

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
echo "Checking for theories that are not part of an Isabelle session:"
echo "==============================================================="
PWD=`pwd`
TMPDIR=`mktemp -d`
isabelle build -D . -l -n | grep $PWD | sed -e "s| *${PWD}/||" | sort -u | grep thy$ > ${TMPDIR}/sessions-thy-files.txt
find * -type f | sort -u | grep thy$ > ${TMPDIR}/actual-thy-files.txt
thylist=`comm -13 ${TMPDIR}/sessions-thy-files.txt ${TMPDIR}/actual-thy-files.txt`
if [ -z "$thylist" ] ; then
echo " * Success: No dangling theories found."
exit 0
else
echo -e "$thylist"
echo "Error: Dangling theories found (see list above)!"
exit 1
fi