In GitHub Actions, you can easily setup TruffleRuby with ruby/setup-ruby:
name: My workflow
on: [push]
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: [ '3.2', truffleruby, truffleruby-head ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- run: ruby -vSee the README of that action for more documentation.
TruffleRuby is now integrated in TravisCI.
Just add truffleruby in the build matrix, such as:
language: ruby
rvm:
- 2.6.1
- truffleruby
- truffleruby-headSee the TravisCI documentation for details. Please report any issue you might find.
If you use another continuous integration system, simply follow these instructions to run TruffleRuby in CI:
download and extract the archive, add it to PATH, and run the post-install script.
Set TRUFFLERUBY_VERSION to the latest TruffleRuby version from GitHub releases.
export TRUFFLERUBY_VERSION=<desired_version>
curl -L https://github.com/truffleruby/truffleruby/releases/download/graal-$TRUFFLERUBY_VERSION/truffleruby-$TRUFFLERUBY_VERSION-linux-amd64.tar.gz | tar xz
export PATH="$PWD/truffleruby-$TRUFFLERUBY_VERSION-linux-amd64/bin:$PATH"
$PWD/truffleruby-$TRUFFLERUBY_VERSION-linux-amd64/lib/truffle/post_install_hook.sh
ruby -vHere are the instructions for manually installing the latest dev build:
curl -L https://github.com/ruby/truffleruby-dev-builder/releases/latest/download/truffleruby-head-ubuntu-18.04.tar.gz | tar xz
export PATH="$PWD/truffleruby-head/bin:$PATH"
$PWD/truffleruby-head/lib/truffle/post_install_hook.sh
ruby -vNote that you also need to ensure GEM_HOME and GEM_PATH are not set, so TruffleRuby uses the correct GEM_HOME and GEM_PATH.
See Using TruffleRuby without a Ruby manager for details.