From fa01fcd38b33bbcece7eeba2d6018baaae0adfd3 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 15 Feb 2024 20:28:34 +0100 Subject: [PATCH] [ci] Upgrade to ruby 3 Fixes #4776 --- .ci/build.sh | 7 ++++--- .ci/inc/regression-tester.inc | 3 ++- .github/workflows/build.yml | 7 ++++--- .github/workflows/troubleshooting.yml | 7 ++++--- docs/pages/release_notes.md | 2 ++ 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 762cdc018d..f0f439a5b4 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -167,11 +167,12 @@ function build() { # -# Installs bundler, which is needed for doc generation and regression tester +# Bundler should be already installed - it should be included in the ruby distribution. +# Bundler is needed for doc generation and regression tester # function pmd_ci_build_setup_bundler() { - pmd_ci_log_info "Installing bundler..." - gem install bundler -v 2.4.22 + pmd_ci_log_info "Checking bundler version..." + bundle --version } # diff --git a/.ci/inc/regression-tester.inc b/.ci/inc/regression-tester.inc index 994e6a8a36..5131e3390d 100644 --- a/.ci/inc/regression-tester.inc +++ b/.ci/inc/regression-tester.inc @@ -19,8 +19,9 @@ function regression_tester_setup_ci() { source .ci/files/public-env >/dev/null 2>&1 rm .ci/files/public-env - if hash "bundler" 2>/dev/null; then + if hash "bundle" 2>/dev/null; then pmd_ci_log_debug "Bundler is already installed" + bundle --version else pmd_ci_log_info "Installing bundler..." gem install bundler diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89690e8f81..daefd95694 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,16 +52,17 @@ jobs: key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} restore-keys: | v3-${{ runner.os }}- - - name: Set up Ruby 2.7 + - name: Set up Ruby 3.3 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.3 - name: Setup Environment shell: bash run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV + #echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/adangel/build-tools/ruby3/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/.github/workflows/troubleshooting.yml b/.github/workflows/troubleshooting.yml index 0b6b92788b..5d0ca0e40d 100644 --- a/.github/workflows/troubleshooting.yml +++ b/.github/workflows/troubleshooting.yml @@ -27,16 +27,17 @@ jobs: key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} restore-keys: | v3-${{ runner.os }}- - - name: Set up Ruby 2.7 + - name: Set up Ruby 3.3 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.3 - name: Setup Environment shell: bash run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV + #echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/adangel/build-tools/ruby3/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7febf0e6ee..37502a5765 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -202,6 +202,7 @@ The rules have been moved into categories with PMD 6. * [#4736](https://github.com/pmd/pmd/issues/4736): \[ci] Improve build procedure * [#4741](https://github.com/pmd/pmd/pull/4741): Add pmd-compat6 module for maven-pmd-plugin * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 + * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets * apex-performance * [#4675](https://github.com/pmd/pmd/issues/4675): \[apex] New Rule: OperationWithHighCostInLoop @@ -720,6 +721,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7. * [#4736](https://github.com/pmd/pmd/issues/4736): \[ci] Improve build procedure * [#4741](https://github.com/pmd/pmd/pull/4741): Add pmd-compat6 module for maven-pmd-plugin * [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6 + * [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3 * [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets * ant * [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule