|
| 1 | +name: Check importing latest Prism |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + schedule: |
| 5 | + - cron: '0 13 * * *' |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + |
| 9 | +jobs: |
| 10 | + # Inspired from the job "build" in ../ci.yml |
| 11 | + test-import-prism: |
| 12 | + if: github.repository == 'oracle/truffleruby' |
| 13 | + runs-on: ubuntu-20.04 |
| 14 | + env: |
| 15 | + BUNDLE_WITHOUT: "memcheck:types" |
| 16 | + steps: |
| 17 | + - name: Clone Prism |
| 18 | + uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + repository: ruby/prism |
| 21 | + path: prism |
| 22 | + - name: Setup system Ruby |
| 23 | + uses: ruby/setup-ruby@v1 |
| 24 | + with: |
| 25 | + ruby-version: ruby |
| 26 | + bundler-cache: true |
| 27 | + working-directory: prism |
| 28 | + |
| 29 | + # Clone truffleruby in truffleruby-ws/truffleruby so that tool/import-prism.sh |
| 30 | + # has the correct relative path to the cloned prism repo. |
| 31 | + - run: mkdir truffleruby-ws |
| 32 | + - name: Clone TruffleRuby |
| 33 | + uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + path: truffleruby-ws/truffleruby |
| 36 | + - name: Setup jt |
| 37 | + run: echo "$PWD/truffleruby-ws/truffleruby/bin" >> $GITHUB_PATH |
| 38 | + |
| 39 | + - name: Restore ~/.mx/cache |
| 40 | + uses: actions/cache@v4 |
| 41 | + with: |
| 42 | + path: ~/.mx/cache |
| 43 | + key: mx-cache-prism-${{ runner.os }}-${{ hashFiles('truffleruby-ws/truffleruby/common.json') }} |
| 44 | + |
| 45 | + - name: Import latest prism in TruffleRuby |
| 46 | + run: tool/import-prism.sh |
| 47 | + working-directory: truffleruby-ws/truffleruby |
| 48 | + |
| 49 | + - uses: ./truffleruby-ws/truffleruby/.github/actions/setup-jvmci-graal |
| 50 | + |
| 51 | + - name: Build TruffleRuby |
| 52 | + run: jt build |
| 53 | + working-directory: truffleruby-ws/truffleruby |
| 54 | + |
| 55 | + - name: Parse test/prism/fixtures/**/*.txt |
| 56 | + run: jt ruby -e 'Dir.glob("test/prism/fixtures/**/*.txt") { |file| puts file; puts Truffle::Debug.parse_ast(File.read(file)) }' |
| 57 | + working-directory: prism |
| 58 | + |
| 59 | + - name: Execute p 1+2 |
| 60 | + run: jt ruby -e 'p 1+2' |
0 commit comments