[ci] Run dogfood for PRs and PMD7
This unifies the build configuration. The dogfood build is now run also for PRs.
This commit is contained in:
41
.ci/build.sh
41
.ci/build.sh
@ -29,7 +29,7 @@ function build() {
|
||||
|
||||
if pmd_ci_utils_is_fork_or_pull_request; then
|
||||
pmd_ci_log_group_start "Build with mvnw"
|
||||
./mvnw clean verify --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
|
||||
|
||||
# Danger is executed only on the linux runner
|
||||
@ -38,6 +38,9 @@ function build() {
|
||||
regression_tester_setup_ci
|
||||
regression_tester_executeDanger
|
||||
pmd_ci_log_group_end
|
||||
|
||||
# also run dogfood for PRs (only on linux)
|
||||
pmd_ci_dogfood
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@ -86,21 +89,7 @@ function build() {
|
||||
pmd_ci_log_group_end
|
||||
|
||||
if pmd_ci_maven_isSnapshotBuild; then
|
||||
if [ "${PMD_CI_MAVEN_PROJECT_VERSION}" != "7.0.0-SNAPSHOT" ]; 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
|
||||
./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
|
||||
else
|
||||
# current maven-pmd-plugin is not compatible with PMD 7 yet.
|
||||
pmd_ci_log_info "Skipping PMD dogfood test with ${PMD_CI_MAVEN_PROJECT_VERSION}"
|
||||
pmd_ci_dogfood
|
||||
fi
|
||||
|
||||
pmd_ci_log_group_start "Executing build with sonar"
|
||||
@ -245,6 +234,26 @@ ${rendered_release_notes}"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Runs the dogfood ruleset with the currently built pmd against itself
|
||||
#
|
||||
function pmd_ci_dogfood() {
|
||||
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
|
||||
}
|
||||
|
||||
build
|
||||
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user