TruffleRuby bindings #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TruffleRuby bindings | |
concurrency: | |
group: "${{github.workflow}}-${{github.ref}}" | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 13 * * *' | |
jobs: | |
# Inspired from https://github.com/oracle/truffleruby/blob/master/.github/workflows/ci.yml | |
test-loader: | |
if: github.repository == 'ruby/prism' | |
runs-on: ubuntu-20.04 # to be consistent with that workflow and test on older platform | |
steps: | |
- name: Clone prism | |
uses: actions/checkout@v4 | |
with: | |
path: prism | |
- name: Setup system Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ruby | |
bundler-cache: true | |
working-directory: prism | |
- run: mkdir truffleruby-ws | |
- name: Clone TruffleRuby | |
uses: actions/checkout@v4 | |
with: | |
repository: oracle/truffleruby | |
path: truffleruby-ws/truffleruby | |
- name: Setup jt | |
run: echo "$PWD/truffleruby-ws/truffleruby/bin" >> $GITHUB_PATH | |
- name: Restore ~/.mx/cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.mx/cache | |
key: mx-cache-${{ runner.os }} | |
- name: Import latest prism in TruffleRuby | |
run: tool/import-prism.sh | |
working-directory: truffleruby-ws/truffleruby | |
- name: Get graal commit | |
id: graal_commit | |
run: echo "graal_commit=$(jt truffle_version)" >> $GITHUB_OUTPUT | |
- name: Clone Graal | |
uses: actions/checkout@v4 | |
with: | |
repository: oracle/graal | |
path: truffleruby-ws/graal | |
ref: ${{ steps.graal_commit.outputs.graal_commit }} | |
- name: Install JVMCI | |
run: jt install jvmci | |
- name: Set JAVA_HOME | |
run: echo "JAVA_HOME=$(jt install jvmci)" >> $GITHUB_ENV | |
- name: Build TruffleRuby | |
run: jt build | |
working-directory: truffleruby-ws/truffleruby | |
- name: Parse test/prism/fixtures/**/*.rb | |
run: jt ruby -e 'Dir.glob("test/prism/fixtures/**/*.txt") { |file| puts file; puts Truffle::Debug.parse_ast(File.read(file)) }' | |
working-directory: prism | |
- name: Execute p 1+2 | |
run: jt ruby -e 'p 1+2' |