[ci] Avoid running dogfood twice for pull requests

This commit is contained in:
Andreas Dangel 2022-02-26 13:40:36 +01:00
parent 524fcd8e38
commit 94dcd9c214
No known key found for this signature in database
GPG Key ID: 93450DF2DF9A3FA3

View File

@ -33,23 +33,6 @@ function build() {
./mvnw clean install --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}" ./mvnw clean install --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}"
pmd_ci_log_group_end pmd_ci_log_group_end
if [ "$(pmd_ci_utils_get_os)" = "linux" ]; then
pmd_ci_log_group_start "Executing PMD dogfood test with ${PMD_CI_MAVEN_PROJECT_VERSION}"
./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}-dogfood" -DgenerateBackupPoms=false
sed -i 's/<version>[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}.*<\/version>\( *<!-- pmd.dogfood.version -->\)/<version>'"${PMD_CI_MAVEN_PROJECT_VERSION}"'<\/version>\1/' pom.xml
if [ "${PMD_CI_MAVEN_PROJECT_VERSION}" = "7.0.0-SNAPSHOT" ]; then
sed -i 's/pmd-dogfood-config\.xml/pmd-dogfood-config7.xml/' pom.xml
fi
./mvnw verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}" \
-DskipTests \
-Dmaven.javadoc.skip=true \
-Dmaven.source.skip=true \
-Dcheckstyle.skip=true
./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}" -DgenerateBackupPoms=false
git checkout -- pom.xml
pmd_ci_log_group_end
fi
# Danger is executed only on the linux runner # Danger is executed only on the linux runner
if [ "$(pmd_ci_utils_get_os)" = "linux" ]; then if [ "$(pmd_ci_utils_get_os)" = "linux" ]; then
pmd_ci_log_group_start "Executing danger" pmd_ci_log_group_start "Executing danger"