Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 8 additions & 310 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,328 +23,26 @@ jobs:
- name: Lint
run: bundle exec rake lint

template:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: gemfiles/2.7/Gemfile
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7.0"
bundler-cache: true
- name: Generate templates
run: bundle exec rake templates
env:
LANG: "C"

typecheck:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: gemfiles/typecheck/Gemfile
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Check Sorbet
run: bundle exec rake typecheck:tapioca typecheck:sorbet
- name: Check Steep
run: bundle exec rake typecheck:steep
- name: Check field kinds
run: rm lib/prism/node.rb && CHECK_FIELD_KIND=true bundle exec rake

build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-latest
# - windows-latest <-- failing with fiddle error, temporarily disabled
# - ubuntu-latest
# - ubuntu-24.04-arm
# - macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true

- run: cat D:/rubyinstaller-head-x64/lib/ruby/3.5.0+4/win32/resolv.rb

- run: bundle install
- name: Run Ruby tests
run: bundle exec rake
shell: bash

build-ibm:
if: github.repository == 'ruby/prism'
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04-ppc64le
- ubuntu-24.04-s390x
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
run: |
sudo apt-get update
sudo apt-get install ruby-full bundler libyaml-dev
- name: Install dependencies
run: sudo bundle install --jobs $(nproc)
- name: Run Ruby tests
run: bundle exec rake
shell: bash

build-ffi:
strategy:
fail-fast: false
matrix:
target:
- { ruby: "head", gemfile: "3.5" }
- { ruby: "jruby-10.0.0.0", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923
- { ruby: "truffleruby", gemfile: "truffleruby" }
runs-on: ubuntu-latest
env:
PRISM_FFI_BACKEND: "true"
BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.target.ruby }}
bundler-cache: true
- name: Run Ruby tests
run: bundle exec rake

build-without-assertions:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Run Ruby tests
run: bundle exec rake compile_no_debug test

build-debug:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-latest
# - windows-latest <-- failing with fiddle error, temporarily disabled
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Run Ruby tests
run: bundle exec rake
env:
PRISM_BUILD_DEBUG: "1"

build-minimal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Run Ruby tests
run: bundle exec rake compile_minimal test
env:
PRISM_BUILD_MINIMAL: "1"

build-java:
runs-on: ubuntu-latest
env:
JRUBY_OPTS: "--dev"
steps:
- uses: actions/checkout@v5
- name: Set up JRuby
uses: ruby/setup-ruby@v1
with:
ruby-version: jruby
bundler-cache: true
- name: Run Java Loader test
run: PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS=1 JRUBY_OPTS="-J-ea" bundle exec rake test:java_loader

lex-ruby:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Lex ruby/ruby
run: bundle exec rake lex:ruby

lex-discourse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Lex discourse/discourse
run: bundle exec rake lex:discourse

lex-top-100:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Lex Top 100 Gems
run: bundle exec rake lex:topgems
- name: Parse Top 100 Gems
run: bundle exec rake parse:topgems
- name: Serialized size stats with all fields
run: bundle exec rake serialized_size:topgems
- name: Recompile with only semantic fields
run: PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS=1 bundle exec rake clobber compile
- name: Serialized size stats with only semantic fields
run: bundle exec rake serialized_size:topgems

memcheck:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Install valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Run Ruby tests with valgrind
run: bundle exec rake test:valgrind

gem-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- run: bundle config --local frozen false
- run: bundle exec rake build:dev
- uses: actions/upload-artifact@v5
with:
name: gem-package
path: pkg
retention-days: 1

gem-install:
needs: ["gem-package"]
strategy:
fail-fast: false
matrix:
target:
- { ruby: "2.7", os: "ubuntu-latest", gemfile: "2.7" }
- { ruby: "3.0", os: "ubuntu-latest", gemfile: "3.0" }
- { ruby: "3.1", os: "ubuntu-latest", gemfile: "3.1" }
- { ruby: "3.2", os: "ubuntu-latest", gemfile: "3.2" }
- { ruby: "3.3", os: "ubuntu-latest", gemfile: "3.3" }
- { ruby: "3.4", os: "ubuntu-latest", gemfile: "3.4" }
- { ruby: "head", os: "ubuntu-latest", gemfile: "3.5" }
- { ruby: "jruby-10.0.0.0", os: "ubuntu-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923
- { ruby: "truffleruby", os: "ubuntu-latest", gemfile: "truffleruby" }

- { ruby: "2.7", os: "macos-latest", gemfile: "2.7" }
- { ruby: "3.0", os: "macos-latest", gemfile: "3.0" }
- { ruby: "3.1", os: "macos-latest", gemfile: "3.1" }
- { ruby: "3.2", os: "macos-latest", gemfile: "3.2" }
- { ruby: "3.3", os: "macos-latest", gemfile: "3.3" }
- { ruby: "3.4", os: "macos-latest", gemfile: "3.4" }
- { ruby: "head", os: "macos-latest", gemfile: "3.5" }
- { ruby: "jruby-10.0.0.0", os: "macos-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923
- { ruby: "truffleruby", os: "macos-latest", gemfile: "truffleruby" }

- { ruby: "2.7", os: "windows-latest", gemfile: "2.7" }
- { ruby: "3.0", os: "windows-latest", gemfile: "3.0" }
- { ruby: "3.1", os: "windows-latest", gemfile: "3.1" }
- { ruby: "3.2", os: "windows-latest", gemfile: "3.2" }
- { ruby: "3.3", os: "windows-latest", gemfile: "3.3" }
- { ruby: "3.4", os: "windows-latest", gemfile: "3.4" }
- { ruby: "head", os: "windows-latest", gemfile: "3.5" }
- { ruby: "jruby-10.0.0.0", os: "windows-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v5
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.target.ruby }}
- uses: actions/download-artifact@v6
with:
name: gem-package
path: pkg
- run: |
gem install --local pkg/prism-*.gem
gem list -d prism
shell: bash
- name: Run tests
run: |
bundle install
rm -rf lib ext # ensure we don't use the local files
rake test
shell: bash

gcc-analyzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Run build with gcc-analyzer enabled
run: |
CFLAGS='-fanalyzer' bundle exec rake compile

clang-analyzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Install clang-analyzer
run: sudo apt-get install -y clang-tools
- name: Run build with clang-analyzer
run: |
scan-build bundle exec rake compile 2>&1 | tee /tmp/scan_build_output.log
grep -q 'scan-build: No bugs found.' /tmp/scan_build_output.log
Loading