Skip to content

Commit

Permalink
ci: test gem packaging and installation on jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed May 20, 2021
1 parent 4317805 commit a9b5e84
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/gem-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,30 @@ jobs:
name: cruby-x86_64-gem
path: gems
retention-days: 1

jruby-package:
name: "jruby-package"
runs-on: ubuntu-latest
container:
image: "larskanis/rake-compiler-dock-jruby:1.1.0"
steps:
- uses: actions/checkout@v2
- run: ./scripts/test-gem-build gems java
- uses: actions/upload-artifact@v2
with:
name: jruby-gem
path: gems
retention-days: 1

jruby-install:
needs: ["jruby-package"]
runs-on: ubuntu-latest
container:
image: "flavorjones/nokogiri-test:jruby-9.2"
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: jruby-gem
path: gems
- run: ./scripts/test-gem-install gems
8 changes: 6 additions & 2 deletions scripts/test-gem-build
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ if [[ $# -lt 2 ]] ; then
exit 1
fi

set -e -u

OUTPUT_DIR=$1
BUILD_NATIVE_GEM=$2

test -e /etc/os-release && cat /etc/os-release

if [[ "${BUILD_NATIVE_GEM}" != "ruby" ]] ; then
if [[ "${XRUBIES:-}" != "" ]] ; then
# normally part of rake-compiler-dock runas which we can't easily use in concourse
. /etc/rubybashrc
ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler
export RAKE_EXTENSION_TASK_NO_NATIVE=true
fi

set -e -x -u
set -x

bundle install --local || bundle install
bundle exec rake set-version-to-timestamp
Expand All @@ -28,6 +30,8 @@ if [[ "${BUILD_NATIVE_GEM}" == "ruby" ]] ; then
# TODO we're only compiling so that we retrieve libxml2/libxslt tarballs, we can do better.
bundle exec rake clean compile
bundle exec rake gem
elif [[ "${BUILD_NATIVE_GEM}" == "java" ]] ; then
bundle exec rake java gem
else
bundle exec rake gem:${BUILD_NATIVE_GEM}:builder FORCE_CROSS_COMPILING=true
fi
Expand Down

0 comments on commit a9b5e84

Please sign in to comment.