Skip to content

Commit

Permalink
Merge pull request #1057 from abelsromero/display-upstream-test-in-ac…
Browse files Browse the repository at this point in the history
…tions

Display upstream test in actions
  • Loading branch information
robertpanzer committed Oct 6, 2021
2 parents 3634ea1 + 283b10f commit 7274e00
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 39 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ jobs:
./gradlew -S -Pskip.signing assemble
unset GEM_PATH GEM_HOME JRUBY_OPTS
./gradlew -S -Pskip.signing check
- name: Upstream Build
if: matrix.os == 'ubuntu-latest' && matrix.java != '8'
run: |
unset GEM_PATH GEM_HOME JRUBY_OPTS
./test-asciidoctor-upstream.sh
build-windows:
name: Build on Windows
runs-on: windows-latest
Expand All @@ -68,3 +63,30 @@ jobs:
shell: cmd
run: |
gradlew.bat -i -S check
test-asciidoctor-upstream:
name: Test Asciidoctor Upstream
needs:
- build
- build-windows
strategy:
fail-fast: false
max-parallel: 2
matrix:
java:
- '11'
- '17'
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Upstream Build
run: |
unset GEM_PATH GEM_HOME JRUBY_OPTS
./ci/test-asciidoctor-upstream.sh
5 changes: 5 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co

== Unreleased

Build Improvement::

* Add Java17 to CI pipelines (@abelsromero) (#1055)
* Improve pipelines to better display Asciidoctor test upstream (@abelsromero) (#1057)

== 2.5.2 (2021-08-08)

Improvement::
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>1.1.7-</version>
<version>1.1.8</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
34 changes: 34 additions & 0 deletions ci/test-asciidoctor-upstream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# This script runs the AsciidoctorJ tests against the specified ref of the Asciidoctor Ruby gem.

set -euo pipefail

# to build against a tag, set REF to a git tag name (e.g., refs/tags/v1.5.2)
REF=${1:-refs/heads/master}
if [[ $REF != refs/* ]]; then
REF=refs/heads/$REF
fi
readonly BASE_REF="${REF##*/}"
readonly SRC_DIR="asciidoctor-${BASE_REF#v}"
readonly WORKING_DIR="build/maven"

rm -rf $WORKING_DIR && mkdir -p $WORKING_DIR
pushd $WORKING_DIR

## Install gem
wget --quiet -O $SRC_DIR.zip https://github.com/asciidoctor/asciidoctor/archive/$REF.zip
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/"`
# we don't use sed -i here for compatibility with OSX
sed "s;<version></version>;<version>$ASCIIDOCTOR_VERSION</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"
popd

## Test against installed gem
./gradlew -S -Pskip.signing -PasciidoctorGemVersion=$ASCIIDOCTOR_VERSION -PuseMavenLocal=true check
exit $?
33 changes: 0 additions & 33 deletions test-asciidoctor-upstream.sh

This file was deleted.

0 comments on commit 7274e00

Please sign in to comment.