From f830e714574eaaa78ed4e68fae93256aaed42612 Mon Sep 17 00:00:00 2001 From: Noel Kuntze Date: Sat, 17 Apr 2021 07:22:39 +0200 Subject: [PATCH] github: Fail sonarcloud test if required environment variables aren't set Closes strongswan/strongswan#330. --- scripts/test.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/test.sh b/scripts/test.sh index 92d3f18d8..97f1a352d 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -144,6 +144,13 @@ printf-builtin) CONFIG="--with-printf-hooks=builtin" ;; all|coverage|sonarcloud) + if [ "$TEST" = "sonarcloud" ]; then + if [ -z "$SONAR_PROJECT" -o -z "$SONAR_ORGANIZATION" -o -z "$SONAR_TOKEN" ]; then + echo "The SONAR_PROJECT, SONAR_ORGANIZATION and SONAR_TOKEN" \ + "environment variables are required to run this test" + exit 1 + fi + fi CONFIG="--enable-all --disable-android-dns --disable-android-log --disable-kernel-pfroute --disable-keychain --disable-lock-profiler --disable-padlock --disable-fuzzing