| name: Ruby | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: {} | |
| merge_group: {} | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: "ubuntu-latest" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: ['3.2', '3.3', '3.4', '4.0', head] | |
| rubyopt: [""] | |
| job: | |
| - test | |
| include: | |
| - ruby: head | |
| job: stdlib_test rubocop | |
| - ruby: "4.0" | |
| job: stdlib_test | |
| - ruby: "4.0" | |
| job: test | |
| rubyopt: "--enable-frozen-string-literal" | |
| - ruby: "4.0" | |
| job: stdlib_test | |
| rubyopt: "--enable-frozen-string-literal" | |
| - ruby: "4.0" | |
| job: rubocop validate test_doc build test_generate_stdlib raap | |
| - ruby: "4.0" | |
| job: typecheck_test | |
| - ruby: asan-release | |
| job: test | |
| env: | |
| RANDOMIZE_STDLIB_TEST_ORDER: "true" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler: none | |
| - name: Set working directory as safe | |
| run: git config --global --add safe.directory $(pwd) | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 | |
| - name: Update rubygems & bundler | |
| run: | | |
| ruby -v | |
| gem update --system | |
| - name: install erb | |
| run: gem install erb | |
| - name: bundle config set with | |
| run: | | |
| echo "NO_MINITEST=true" >> $GITHUB_ENV | |
| bundle config set --local without 'minitest' | |
| if: ${{ contains(matrix.ruby, 'head') }} | |
| - name: bundle config set force_ruby_platform true if head | |
| if: ${{ contains(matrix.ruby, 'head') }} | |
| run: | | |
| bundle config set force_ruby_platform true | |
| - name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head | |
| if: ${{ contains(matrix.ruby, 'head') }} | |
| run: bundle config set --local version system | |
| - name: Skip installing type checkers | |
| if: ${{ ! contains(matrix.job, 'typecheck_test') }} | |
| run: | | |
| bundle config set without 'typecheck_test' | |
| - name: bin/setup | |
| run: | | |
| bin/setup | |
| - name: Configure ASAN options | |
| if: ${{ contains(matrix.ruby, 'asan') }} | |
| run: | | |
| echo "ASAN_OPTIONS=abort_on_error=1" >> $GITHUB_ENV | |
| - name: Run test | |
| run: | | |
| bundle exec rake ${{ matrix.job }} | |
| ffi_backend: | |
| runs-on: "ubuntu-latest" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # The FFI backend on MRI, forced with RBS_FFI_BACKEND=1. This is | |
| # the cheap lane that catches most FFI backend regressions. | |
| - ruby: "4.0" | |
| rbs_ffi_backend: "1" | |
| # The FFI backend on JRuby, where it is the only backend. | |
| - ruby: jruby | |
| rbs_ffi_backend: "" | |
| env: | |
| RBS_FFI_BACKEND: ${{ matrix.rbs_ffi_backend }} | |
| # The main Gemfile pulls in development gems whose C extensions cannot | |
| # be built on JRuby; this lane only needs the parser test subset. | |
| BUNDLE_GEMFILE: gemfiles/ffi_backend.gemfile | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler: none | |
| - name: Set working directory as safe | |
| run: git config --global --add safe.directory $(pwd) | |
| - name: Install dependencies | |
| run: bundle install --jobs 4 --retry 3 | |
| - name: Run parser tests | |
| run: bundle exec rake test:parser | |
| C99_compile: | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: ['4.0', head] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| brew install ruby-build | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler: none | |
| - name: Set working directory as safe | |
| run: git config --global --add safe.directory $(pwd) | |
| - name: Update rubygems & bundler | |
| run: | | |
| ruby -v | |
| gem update --system | |
| - name: install erb | |
| run: gem install erb | |
| - name: clang version | |
| run: clang --version | |
| - name: bundle config set force_ruby_platform true if head | |
| if: ${{ contains(matrix.ruby, 'head') }} | |
| run: | | |
| bundle config set force_ruby_platform true | |
| - name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head | |
| if: ${{ contains(matrix.ruby, 'head') }} | |
| run: bundle config set --local version system | |
| - name: bin/setup | |
| run: | | |
| bin/setup | |
| - run: bundle exec rake clean compile_c99 | |
| clang_compile: | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: ['4.0', head] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| brew install ruby-build | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler: none | |
| - name: Set working directory as safe | |
| run: git config --global --add safe.directory $(pwd) | |
| - name: Update rubygems & bundler | |
| run: | | |
| ruby -v | |
| gem update --system | |
| - name: install erb | |
| run: gem install erb | |
| - name: clang version | |
| run: clang --version | |
| - name: bundle config set force_ruby_platform true if head | |
| if: ${{ contains(matrix.ruby, 'head') }} | |
| run: | | |
| bundle config set force_ruby_platform true | |
| - name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head | |
| if: ${{ contains(matrix.ruby, 'head') }} | |
| run: bundle config set --local version system | |
| - name: bin/setup | |
| run: | | |
| bin/setup | |
| - run: bundle exec rake clean compile |