ci: run style unit tests only if we target develop (#27472)

Some tests assume the base branch is develop, but this branch may not
have been checked out.
This commit is contained in:
Harmen Stoppels
2021-11-18 13:00:39 +01:00
committed by Massimiliano Culpo
parent c8daa7218d
commit 654f6839eb
5 changed files with 28 additions and 12 deletions

View File

@@ -14,15 +14,15 @@
# Usage:
# run-flake8-tests
#
. "$(dirname $0)/setup.sh"
. "$(dirname "$0")/setup.sh"
BASE=""
if [ -n "$GITHUB_BASE_REF" ]; then
BASE="--base ${GITHUB_BASE_REF}"
args=()
if [[ -n $GITHUB_BASE_REF ]]; then
args+=("--base" "${GITHUB_BASE_REF}")
fi
# verify that the code style is correct
spack style --root-relative $BASE
spack style --root-relative "${args[@]}"
# verify that the license headers are present
spack license verify