name: Ruby on: push: branches: - main pull_request: jobs: build: runs-on: ubuntu-latest name: Ruby ${{ matrix.ruby }} strategy: matrix: include: - ruby: '2.6.8' lockfile: Gemfile.lock.ruby-2.6 bundler: '2.4.22' - ruby: '3.3.4' lockfile: Gemfile.lock.ruby-3.3 bundler: '' - ruby: '4.0.5' lockfile: Gemfile.lock.ruby-4.0 bundler: '' env: BUNDLE_LOCKFILE: ${{ matrix.lockfile }} steps: - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: false - name: Install Bundler for Ruby 2.6 if: matrix.bundler != '' run: gem install bundler -v "${{ matrix.bundler }}" - name: Resolve dependencies run: | if [ -n "${{ matrix.bundler }}" ]; then bundle _${{ matrix.bundler }}_ lock --lockfile="$BUNDLE_LOCKFILE" bundle _${{ matrix.bundler }}_ install --jobs 4 else bundle lock --lockfile="$BUNDLE_LOCKFILE" bundle install --jobs 4 fi - name: Run the default task run: | if [ -n "${{ matrix.bundler }}" ]; then bundle _${{ matrix.bundler }}_ exec rake else bundle exec rake fi