From 17c9b62de5ef8c5fdfd52a82a13c437bf0e9af7e Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Tue, 11 Oct 2022 01:12:53 +0200 Subject: [PATCH] Fix upstream tests Force "-SNAPSHOT" suffix to upstream version to install gem consistently. gem-maven-plugin appends it when the gem version is not strictly semver installing a gem with "-SNAPSHOT" in the version but not in the maven repo path. --- .github/workflows/continuous-integration.yaml | 6 +++--- ci/test-asciidoctor-upstream.sh | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index c521fa2cb..399079b49 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -66,7 +66,7 @@ jobs: gradlew.bat -i -S check test-asciidoctor-upstream: name: Test Asciidoctor Upstream - needs: + needs: - build - build-windows strategy: @@ -80,10 +80,10 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 1 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: distribution: temurin java-version: ${{ matrix.java }} diff --git a/ci/test-asciidoctor-upstream.sh b/ci/test-asciidoctor-upstream.sh index 9ecba523d..4e0651675 100755 --- a/ci/test-asciidoctor-upstream.sh +++ b/ci/test-asciidoctor-upstream.sh @@ -20,15 +20,16 @@ wget --quiet -O $SRC_DIR.zip https://github.com/asciidoctor/asciidoctor/archive/ unzip -q $SRC_DIR.zip cp ../../ci/asciidoctor-gem-installer.pom $SRC_DIR/pom.xml cd $SRC_DIR -readonly ASCIIDOCTOR_VERSION=`grep 'VERSION' ./lib/asciidoctor/version.rb | sed "s/.*'\(.*\)'.*/\1/" | sed "s/[.]dev$/.dev-SNAPSHOT/"` +# force SNAPSHOT trailing to keep always consistency, gem-maven-plugin adds it depending on version format, breaking the build +readonly ASCIIDOCTOR_VERSION="$(grep 'VERSION' ./lib/asciidoctor/version.rb | sed "s/.*'\(.*\)'.*/\1/" | sed "s/[.]dev$/.dev-SNAPSHOT/")-SNAPSHOT" # we don't use sed -i here for compatibility with OSX sed "s;;$ASCIIDOCTOR_VERSION;" pom.xml > pom.xml.sedtmp && \ mv -f pom.xml.sedtmp pom.xml # we override the jruby version here with one supported by java9, additionally java9 needs some add-opens arguments that need to be ignored on older jvms -mvn install -B --no-transfer-progress -Dgemspec=asciidoctor.gemspec -Djruby.version=9.2.17.0 -Djruby.jvmargs="-XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED" +mvn install -B --no-transfer-progress -Dgemspec="asciidoctor.gemspec" -Djruby.version=9.2.17.0 -Djruby.jvmargs="-XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED" popd ## Test against installed gem -./gradlew -S -Pskip.signing -PasciidoctorGemVersion=$ASCIIDOCTOR_VERSION -PuseMavenLocal=true check +./gradlew --no-daemon -S -Pskip.signing -PasciidoctorGemVersion="$ASCIIDOCTOR_VERSION" -PuseMavenLocal=true check exit $?