Skip to content

Run only benchmark #1065

Run only benchmark

Run only benchmark #1065

Workflow file for this run

name: Main
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
ci:
name: CI
strategy:
fail-fast: false
matrix:
# Due to https://github.com/actions/runner/issues/849, we have to use
# quotes for '3.0' -- without quotes, CI sees '3' and runs the latest.
ruby: [2.7, 3.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Conditionally configure bundler via environment variables as advised
# * https://github.com/ruby/setup-ruby#bundle-config
- name: Set bundler environment variables
run: |
echo "BUNDLE_WITHOUT=checks:docs" >> $GITHUB_ENV
if: matrix.ruby != 3.2
# Use 'bundler-cache: true' instead of actions/cache as advised:
# * https://github.com/actions/cache/blob/main/examples.md#ruby---bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run benchmarks on Ruby 2.7 or 3.2
run: |
BUNDLE_GEMFILE=benchmarks/Gemfile bundle install --jobs 4 --retry 3
BUNDLE_GEMFILE=benchmarks/Gemfile bundle exec ruby benchmarks/benchmarks.rb
if: matrix.ruby == '2.7' || matrix.ruby == '3.2'