Test Loader.java with TruffleRuby #987
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: Test Loader.java with TruffleRuby | |
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@v3 | |
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@v3 | |
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@v3 | |
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: Install JVMCI | |
run: jt install jvmci | |
- name: Set JAVA_HOME | |
run: echo "JAVA_HOME=$(jt install jvmci)" >> $GITHUB_ENV | |
- name: Get graal commit | |
id: graal_commit | |
run: echo "graal_commit=$(jt truffle_version)" >> $GITHUB_OUTPUT | |
- name: Clone Graal | |
uses: actions/checkout@v3 | |
with: | |
repository: oracle/graal | |
path: truffleruby-ws/graal | |
ref: ${{ steps.graal_commit.outputs.graal_commit }} | |
- name: Download dependencies | |
run: jt -q mx --env jvm graalvm-dist-name | |
working-directory: truffleruby-ws/truffleruby | |
- name: Build TruffleRuby | |
run: jt build -- --dependencies "$(jt -q mx --env jvm graalvm-dist-name)" | |
working-directory: truffleruby-ws/truffleruby | |
- name: Parse test/prism/fixtures/**/*.rb | |
run: jt ruby -e 'Dir.glob("test/prism/fixtures/**/*.rb") { |file| puts file; Truffle::Debug.prism_parse(File.read(file)) }' | |
working-directory: prism | |
- name: Parse src/main/ruby/truffleruby/**/*.rb | |
run: jt ruby -e 'Dir.glob("src/main/ruby/truffleruby/**/*.rb") { |file| puts file; Truffle::Debug.prism_parse(File.read(file)) }' | |
working-directory: truffleruby-ws/truffleruby | |
- name: Execute p 1+2 | |
run: jt ruby -e 'Truffle::Debug.prism_execute "p 1+2"' |