summaryrefslogtreecommitdiff
path: root/tools/ci/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ci/jobs')
-rwxr-xr-xtools/ci/jobs/cpplint.sh32
-rwxr-xr-xtools/ci/jobs/gcc47_c++11.sh1
-rwxr-xr-xtools/ci/jobs/gcc48_c++11.sh2
-rwxr-xr-xtools/ci/jobs/gcc49_c++11.sh2
-rwxr-xr-xtools/ci/jobs/gcc49_sanitize.sh2
-rwxr-xr-xtools/ci/jobs/gcc49_sanitize_tests.sh2
-rwxr-xr-xtools/ci/jobs/mplint.sh25
-rwxr-xr-xtools/ci/jobs/nsiqcppstyle.sh20
-rwxr-xr-xtools/ci/jobs/potfiles_update_check.sh21
9 files changed, 64 insertions, 43 deletions
diff --git a/tools/ci/jobs/cpplint.sh b/tools/ci/jobs/cpplint.sh
index 7bbccf271..b8331ff29 100755
--- a/tools/ci/jobs/cpplint.sh
+++ b/tools/ci/jobs/cpplint.sh
@@ -1,14 +1,21 @@
#!/usr/bin/env bash
-export LOGFILE=cpplint.log
+set -e # Fail if any command fails
+set -u # Fail if any variable is unset when used
+export LOGFILE=cpplint.log
source ./tools/ci/scripts/init.sh
# Re-download if not executable or older than a day
if [[ ! -x cpplint.py \
|| $(find cpplint.py -mtime 1 -print) ]]; then
- tools/ci/scripts/retry.sh wget "https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py"
- chmod +x cpplint.py
+ #tools/ci/scripts/retry.sh wget "https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py"
+ # Google no longer offers their cpplint and suggests using the following one, instead:
+ tools/ci/scripts/retry.sh wget "https://raw.githubusercontent.com/cpplint/cpplint/refs/tags/2.0.0/cpplint.py"
+ chmod +x cpplint.py
+
+ # env python -> env python3
+ sed -i -s -e '1s/python$/python3/' cpplint.py
fi
declare -a args
@@ -40,19 +47,20 @@ args+=("--filter=\
-build/c++tr1"\
)
+# Cannot find a good way to handle execution errors
+# (such cpplint.py demanding a version of Python that does not exist)
+# So use || true here and assume any other problems will be exposed
+# by the grep below. Addendum: no more grep. YMMV.
find src \
-type f \
- -name "*.cpp" -o -name "*.hpp" -o -name "*.h" -o -name "*.cc" \
- -exec ./cpplint.py "${args[@]}" {} \+ 2>${ERRFILE}2
+ \( -name "*.cc" \
+ -o \( -name "*.cpp" -a \! -path src/debug/nvwa/debug_new.cpp \) \
+ -o \( -name "*.h" -a \! -path src/unittests/doctest.h \) \
+ -o \( -name "*.hpp" -a \! -path src/unittests/catch.hpp \) \
+ \) -exec ./cpplint.py --verbose=5 "${args[@]}" {} \+ 2>"$ERRFILE"
+ #|| true
-grep ": " ${ERRFILE}2 | grep -v -e "src/debug/" \
- -e "unittests/doctest.h" \
- -e "unittests/catch.hpp" \
- -e "debug/fast_mutex" \
- -e "sdl2gfx/SDL2" \
- >${ERRFILE}
-rm ${ERRFILE}2
run_check_warnings
diff --git a/tools/ci/jobs/gcc47_c++11.sh b/tools/ci/jobs/gcc47_c++11.sh
index 3860ee79e..b93a03b7b 100755
--- a/tools/ci/jobs/gcc47_c++11.sh
+++ b/tools/ci/jobs/gcc47_c++11.sh
@@ -16,7 +16,6 @@ source ./tools/ci/scripts/init.sh
export CXXFLAGS="$CXXFLAGS -ggdb3 -O2 -pipe -ffast-math \
-funswitch-loops \
--std=c++0x \
-fno-omit-frame-pointer $POST_CXXFLAGS"
do_init
diff --git a/tools/ci/jobs/gcc48_c++11.sh b/tools/ci/jobs/gcc48_c++11.sh
index 9652f1fc1..c6030ea22 100755
--- a/tools/ci/jobs/gcc48_c++11.sh
+++ b/tools/ci/jobs/gcc48_c++11.sh
@@ -31,7 +31,7 @@ export CXXFLAGS="$CXXFLAGS -ggdb3 -O2 -pipe -ffast-math \
-Wwrite-strings -Wstack-protector -Wshadow -Wunused-macros -Wsynth \
-Wbuiltin-macro-redefined -Wctor-dtor-privacy -Wdeprecated \
-Wendif-labels -Wformat=1 -Wimport -Wnon-virtual-dtor -Wpsabi \
--Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++11-compat -std=c++0x \
+-Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++17-compat -std=c++11 \
-Wdelete-non-virtual-dtor -Wmaybe-uninitialized -Wunused-local-typedefs \
-Wvector-operation-performance -Wfree-nonheap-object -Winvalid-memory-model \
-Wnarrowing -Wzero-as-null-pointer-constant -funsafe-loop-optimizations \
diff --git a/tools/ci/jobs/gcc49_c++11.sh b/tools/ci/jobs/gcc49_c++11.sh
index e9ecdc154..09c161367 100755
--- a/tools/ci/jobs/gcc49_c++11.sh
+++ b/tools/ci/jobs/gcc49_c++11.sh
@@ -30,7 +30,7 @@ export CXXFLAGS="$CXXFLAGS -ggdb3 -O2 -pipe -ffast-math \
-Wwrite-strings -Wstack-protector -Wshadow -Wunused-macros -Wsynth \
-Wbuiltin-macro-redefined -Wctor-dtor-privacy -Wdeprecated \
-Wendif-labels -Wformat=1 -Wimport -Wnon-virtual-dtor -Wpsabi \
--Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++11-compat -std=c++0x \
+-Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++17-compat -std=c++11 \
-Wdelete-non-virtual-dtor -Wmaybe-uninitialized -Wunused-local-typedefs \
-Wvector-operation-performance -Wfree-nonheap-object -Winvalid-memory-model \
-Wnarrowing -Wzero-as-null-pointer-constant -funsafe-loop-optimizations \
diff --git a/tools/ci/jobs/gcc49_sanitize.sh b/tools/ci/jobs/gcc49_sanitize.sh
index f9ae60711..3c22f7e21 100755
--- a/tools/ci/jobs/gcc49_sanitize.sh
+++ b/tools/ci/jobs/gcc49_sanitize.sh
@@ -32,7 +32,7 @@ export CXXFLAGS="$CXXFLAGS -ggdb3 -O2 -ffast-math \
-Wwrite-strings -Wstack-protector -Wshadow -Wunused-macros -Wsynth \
-Wbuiltin-macro-redefined -Wctor-dtor-privacy -Wdeprecated \
-Wendif-labels -Wformat=1 -Wimport -Wnon-virtual-dtor -Wpsabi \
--Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++11-compat -std=c++0x \
+-Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++17-compat -std=c++11 \
-Wdelete-non-virtual-dtor -Wmaybe-uninitialized -Wunused-local-typedefs \
-Wvector-operation-performance -Wfree-nonheap-object -Winvalid-memory-model \
-Wnarrowing -Wzero-as-null-pointer-constant -funsafe-loop-optimizations \
diff --git a/tools/ci/jobs/gcc49_sanitize_tests.sh b/tools/ci/jobs/gcc49_sanitize_tests.sh
index 787022b13..2432dc02d 100755
--- a/tools/ci/jobs/gcc49_sanitize_tests.sh
+++ b/tools/ci/jobs/gcc49_sanitize_tests.sh
@@ -32,7 +32,7 @@ export CXXFLAGS="$CXXFLAGS -ggdb3 -O2 -ffast-math \
-Wwrite-strings -Wstack-protector -Wshadow -Wunused-macros -Wsynth \
-Wbuiltin-macro-redefined -Wctor-dtor-privacy -Wdeprecated \
-Wendif-labels -Wformat=1 -Wimport -Wnon-virtual-dtor -Wpsabi \
--Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++11-compat -std=c++0x \
+-Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++17-compat -std=c++11 \
-Wdelete-non-virtual-dtor -Wmaybe-uninitialized -Wunused-local-typedefs \
-Wvector-operation-performance -Wfree-nonheap-object -Winvalid-memory-model \
-Wnarrowing -Wzero-as-null-pointer-constant -funsafe-loop-optimizations \
diff --git a/tools/ci/jobs/mplint.sh b/tools/ci/jobs/mplint.sh
index 573cd1c85..60422e5f6 100755
--- a/tools/ci/jobs/mplint.sh
+++ b/tools/ci/jobs/mplint.sh
@@ -1,29 +1,18 @@
#!/usr/bin/env bash
-export CC=gcc
-export CXX=g++
-
-if [ "$NEWCC" != "" ]; then
- export CC="$NEWCC"
-fi
-if [ "$NEWCXX" != "" ]; then
- export CXX="$NEWCXX"
-fi
+set -e # Fail if any command fails
+set -u # Fail if any variable is unset when used
export LOGFILE=mplint_po.log
-
source ./tools/ci/scripts/init.sh
-export CXXFLAGS="-std=gnu++11"
+rm -rf mplint || true
+tools/ci/scripts/retry.sh wget -O mplint-release.zip "$MPLINT_PACKAGE_URL"
+unzip mplint-release.zip
-do_init
+read mplint_commit < mplint-version.txt
+printf "Using mplint: %s\n" "$mplint_commit"
-rm -rf mplint || true
-gitclone https://git.themanaworld.org/mana mplint.git
-cd mplint
-run_configure_simple
-run_make
-cd ..
echo " " >config.h
for task in "$@"; do
run_mplint $task
diff --git a/tools/ci/jobs/nsiqcppstyle.sh b/tools/ci/jobs/nsiqcppstyle.sh
index fd9f0499a..e83c8e932 100755
--- a/tools/ci/jobs/nsiqcppstyle.sh
+++ b/tools/ci/jobs/nsiqcppstyle.sh
@@ -1,19 +1,25 @@
#!/usr/bin/env bash
-export LOGFILE=nsiqcppstyle.log
+set -e # Fail if any command fails
+set -u # Fail if any variable is unset when used
+export LOGFILE=nsiqcppstyle.log
source ./tools/ci/scripts/init.sh
rm -rf nsiqcppstyle.git
./tools/ci/scripts/retry.sh git clone https://gitlab.com/4144/nsiqcppstyle nsiqcppstyle.git
+# replace python -> python2 on line3. (Explicitly call python2)
+sed -i -s -e '3s/^python/python2/' ./nsiqcppstyle.git/nsiqcppstyle
+
./nsiqcppstyle.git/nsiqcppstyle --ci --show-url src \
| grep -v -e "catch.hpp" \
-e "doctest.h" \
-e "sdl2gfx" \
-e "/debug/" \
- > logs/nsiqcppstyle1.log
+ > "$ERRFILE_UNFILTERED"
+# If grep does not find any messages, it exits non-zero. Therefore, use ||true
grep -v -E \
-e "gamemodifiers[.]cpp(.+): Incorrect align on long parameter list in front of '(N_|{|})'" \
-e "graphics_calcImageRect[.]hpp(.+): function [(]calcTileVertexesInline[)] has non named parameter" \
@@ -23,10 +29,8 @@ grep -v -E \
-e "windowmenu[.]cpp(.+): Incorrect align on long parameter list in front of '(.|Visible_true)', it should be aligen in column 15" \
-e "channeltab[.]h(.+): Incorrect align on long parameter list in front of 'const'" \
-e "/enums/simpletypes/(.+): function [(]defIntEnum[)] has non named parameter" \
- logs/nsiqcppstyle1.log > "${ERRFILE}"
+ "$ERRFILE_UNFILTERED" > "$ERRFILE" || true
+
+run_check_warnings
-if [[ -s "${ERRFILE}" ]]; then
- echo "Warnings detected"
- cat ${ERRFILE}
- exit 1
-fi
+echo ok
diff --git a/tools/ci/jobs/potfiles_update_check.sh b/tools/ci/jobs/potfiles_update_check.sh
new file mode 100755
index 000000000..6610d4332
--- /dev/null
+++ b/tools/ci/jobs/potfiles_update_check.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -e # Fail if any command fails
+set -u # Fail if any variable is unset when used
+
+export LOGFILE=potfiles.log
+source ./tools/ci/scripts/init.sh
+
+./po/POTgen.sh
+
+# error if POTgen applied any changes
+git diff >> "$ERRFILE"
+
+# Save in-progress work in case someone runs this script manually.
+#git stash push -m "POTgen run"
+# Restore repository back to original state for other ci jobs.
+#git reset --hard
+
+run_check_warnings
+
+echo ok