summaryrefslogtreecommitdiff
path: root/tools/ci/scripts
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2024-05-10 21:45:26 +0000
committerFedja Beader <fedja@protonmail.ch>2024-05-10 21:45:26 +0000
commit46aed0c6b9be60355d89b4a9cf264f45290986b7 (patch)
tree0d0902891c2858fe492187069664acbb838c0479 /tools/ci/scripts
parentdd1627eb548a7705f749d2e8529207e6123e5e2e (diff)
downloadmv-46aed0c6b9be60355d89b4a9cf264f45290986b7.tar.gz
mv-46aed0c6b9be60355d89b4a9cf264f45290986b7.tar.bz2
mv-46aed0c6b9be60355d89b4a9cf264f45290986b7.tar.xz
mv-46aed0c6b9be60355d89b4a9cf264f45290986b7.zip
Download mplint release instead of recompiling every time
Saves 1min10s by not compiling and another 15s by moving it together with linters. Squashed with: * Make sure mplint internal error or failure to run is detected * Make mplint breaking cause job to fail * Move linters out of lightweight.. goes faster, 3m46s -> 1m45s * Make script fail if any command returns nonzero or if any variable is unset. * Donwload mplint instead of building it **** mana/plus!80
Diffstat (limited to 'tools/ci/scripts')
-rwxr-xr-xtools/ci/scripts/exit.sh2
-rwxr-xr-xtools/ci/scripts/init.sh39
2 files changed, 22 insertions, 19 deletions
diff --git a/tools/ci/scripts/exit.sh b/tools/ci/scripts/exit.sh
index 1f13618c1..5c63a1d1b 100755
--- a/tools/ci/scripts/exit.sh
+++ b/tools/ci/scripts/exit.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
-rm $ERRFILE
+rm -f "$ERRFILE"
diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh
index 9512e9b66..ed25a59e8 100755
--- a/tools/ci/scripts/init.sh
+++ b/tools/ci/scripts/init.sh
@@ -3,7 +3,7 @@
export dir=$(pwd)
export ERRFILE=${dir}/logs/${LOGFILE}
-rm ${ERRFILE}
+rm -f "$ERRFILE"
function do_init {
$CC --version
@@ -104,11 +104,11 @@ function check_error {
}
function run_configure_simple {
- rm $ERRFILE
+ rm -f "$ERRFILE"
echo "autoreconf -i"
autoreconf -i 2>$ERRFILE
check_error $?
- rm $ERRFILE
+ rm -f "$ERRFILE"
echo "./configure $*"
./configure $* 2>$ERRFILE
check_error $?
@@ -117,14 +117,14 @@ function run_configure_simple {
function run_configure {
run_configure_simple $*
- rm $ERRFILE
+ rm -f "$ERRFILE"
cd po
echo "make update-gmo"
make update-gmo 2>$ERRFILE
check_error $?
cd ..
- rm $ERRFILE
+ rm -f "$ERRFILE"
cd po
echo "make update-po"
make update-po 2>$ERRFILE
@@ -133,14 +133,14 @@ function run_configure {
}
function run_cmake {
- rm $ERRFILE
+ rm -f "$ERRFILE"
echo "cmake ."
cmake . 2>$ERRFILE
check_error $?
}
function run_make {
- rm $ERRFILE
+ rm -f "$ERRFILE"
if [ "$JOBS" == "" ]; then
export JOBS=2
echo "No JOBS defined"
@@ -153,7 +153,7 @@ function run_make {
}
function run_make_check {
- rm $ERRFILE
+ rm -f "$ERRFILE"
if [ "$JOBS" == "" ]; then
export JOBS=2
echo "No JOBS defined"
@@ -211,7 +211,7 @@ function run_check_warnings {
}
function run_h {
- rm $ERRFILE
+ rm -f "$ERRFILE"
echo "$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h"
$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h 2>$ERRFILE
if [[ -s "$ERRFILE" ]]; then
@@ -221,7 +221,7 @@ function run_h {
}
function run_tarball {
- rm $ERRFILE
+ rm -f "$ERRFILE"
echo "make dist-xz"
make dist-xz 2>$ERRFILE
check_error $?
@@ -234,14 +234,17 @@ function run_tarball {
}
function run_mplint {
- rm $ERRFILE
- echo "mplint/src/mplint $*"
- mplint/src/mplint "$@" \
- | grep -v \
- -e "src/unittests/doctest.h" \
- -e "src/unittests/catch.hpp" \
- -e "src/debug/" \
- > "$ERRFILE"
+ rm -f "$ERRFILE"
+ echo "\$ ./mplint $*"
+
+ ./mplint "$@" > "$ERRFILE.unfiltered"
+
+ # if grep does not find any messages, it exits non-zero
+ grep -v \
+ -e "src/unittests/doctest.h" \
+ -e "src/unittests/catch.hpp" \
+ -e "src/debug/" \
+ < "$ERRFILE.unfiltered" > "$ERRFILE" || true
run_check_warnings
}