Compare commits
3 Commits
d536dcff8a
...
712a372372
Author | SHA1 | Date |
---|---|---|
Achim D. Brucker | 712a372372 | |
Achim D. Brucker | 343e4a4012 | |
Achim D. Brucker | eca181309d |
|
@ -1,7 +1,10 @@
|
||||||
pipeline:
|
pipeline:
|
||||||
build:
|
build:
|
||||||
image: docker.io/logicalhacking/isabelle2021
|
image: docker.io/logicalhacking/isabelle2022
|
||||||
commands:
|
commands:
|
||||||
|
- ./.woodpecker/check_dangling_theories
|
||||||
|
- ./.woodpecker/check_external_file_refs
|
||||||
|
- ./.woodpecker/check_quick_and_dirty
|
||||||
- export ARTIFACT_DIR=$CI_WORKSPACE/.artifacts/$CI_REPO/$CI_BRANCH/$CI_BUILD_NUMBER/
|
- export ARTIFACT_DIR=$CI_WORKSPACE/.artifacts/$CI_REPO/$CI_BRANCH/$CI_BUILD_NUMBER/
|
||||||
- mkdir -p $ARTIFACT_DIR
|
- mkdir -p $ARTIFACT_DIR
|
||||||
- export `isabelle getenv ISABELLE_HOME_USER`
|
- export `isabelle getenv ISABELLE_HOME_USER`
|
||||||
|
@ -23,7 +26,7 @@ pipeline:
|
||||||
from_secret: artifacts_ssh
|
from_secret: artifacts_ssh
|
||||||
user: artifacts
|
user: artifacts
|
||||||
notify:
|
notify:
|
||||||
image: drillster/drone-email
|
image: docker.io/drillster/drone-email
|
||||||
settings:
|
settings:
|
||||||
host: smtp.0x5f.org
|
host: smtp.0x5f.org
|
||||||
username: woodpecker
|
username: woodpecker
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
failuremsg="Error"
|
||||||
|
failurecode=1
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
--warning|-w)
|
||||||
|
failuremsg="Warning"
|
||||||
|
failurecode=0;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
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 "$failuremsg: Dangling theories found (see list above)!"
|
||||||
|
exit $failurecode
|
||||||
|
fi
|
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
failuremsg="Error"
|
||||||
|
failurecode=1
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
--warning|-w)
|
||||||
|
failuremsg="Warning"
|
||||||
|
failurecode=0;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
DIRREGEXP="\\.\\./"
|
||||||
|
|
||||||
|
echo "Checking for references pointing outside of session directory:"
|
||||||
|
echo "=============================================================="
|
||||||
|
|
||||||
|
REGEXP=$DIRREGEXP
|
||||||
|
DIR=$DIRMATCH
|
||||||
|
failed=0
|
||||||
|
for i in $(seq 1 10); do
|
||||||
|
FILES=`find * -mindepth $((i-1)) -maxdepth $i -type f | xargs`
|
||||||
|
if [ -n "$FILES" ]; then
|
||||||
|
grep -s ${REGEXP} ${FILES}
|
||||||
|
exit=$?
|
||||||
|
if [ "$exit" -eq 0 ] ; then
|
||||||
|
failed=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
REGEXP="${DIRREGEXP}${REGEXP}"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$failed" -ne 0 ] ; then
|
||||||
|
echo "$failuremsg: Forbidden reference to files outside of their session directory!"
|
||||||
|
exit $failurecode
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " * Success: No relative references to files outside of their session directory found."
|
||||||
|
exit 0
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
failuremsg="Error"
|
||||||
|
failurecode=1
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
--warning|-w)
|
||||||
|
failuremsg="Warning"
|
||||||
|
failurecode=0;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Checking for sessions with quick_and_dirty mode enabled:"
|
||||||
|
echo "========================================================"
|
||||||
|
|
||||||
|
rootlist=`find -name 'ROOT' -exec grep -l 'quick_and_dirty *= *true' {} \;`
|
||||||
|
|
||||||
|
if [ -z "$rootlist" ] ; then
|
||||||
|
echo " * Success: No sessions with quick_and_dirty mode enabled found."
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo -e "$rootlist"
|
||||||
|
echo "$failuremsg: Sessions with quick_and_dirty mode enabled found (see list above)!"
|
||||||
|
exit $failurecode
|
||||||
|
fi
|
Loading…
Reference in New Issue