Merge pull request #859 from bugsnag/khushbu/PLAT-16484-resolve-unit-… #624
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test | |
| on: [push, pull_request] | |
| jobs: | |
| specs: | |
| runs-on: ${{ matrix.os || 'ubuntu-latest' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0'] | |
| optional-groups: ['test sidekiq'] | |
| include: | |
| - ruby-version: '1.9' | |
| os: 'ubuntu-22.04' | |
| optional-groups: 'test' | |
| - ruby-version: '2.0' | |
| optional-groups: 'test' | |
| - ruby-version: '2.1' | |
| optional-groups: 'test' | |
| - ruby-version: 'jruby' | |
| optional-groups: 'test' | |
| modern-bundler: true | |
| # Mark Ruby versions >= 3.4 as using modern bundler | |
| - ruby-version: '3.4' | |
| modern-bundler: true | |
| - ruby-version: '4.0' | |
| modern-bundler: true | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: install Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| # For Ruby 3.4+ (Bundler ≥ 2.4.0), use bundle config set with and bundle binstubs --all, | |
| # since the --with and --binstubs flags have been removed from modern Bundler versions | |
| - name: Install dependencies (Ruby >= 3.4) | |
| if: ${{ matrix.modern-bundler == true }} | |
| run: | | |
| bundle config set with "${{ matrix.optional-groups }}" | |
| bundle install | |
| bundle binstubs --all | |
| # For Ruby < 3.4, use the legacy flags which are still supported | |
| - name: Install dependencies (Ruby < 3.4) | |
| if: ${{ matrix.modern-bundler != true }} | |
| run: bundle install --with "${{ matrix.optional-groups }}" --binstubs | |
| - run: ./bin/rake spec | |
| linting: | |
| runs-on: ubuntu-latest | |
| env: | |
| BUNDLE_WITH: rubocop | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: install Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 2.7 | |
| bundler-cache: true | |
| - run: bundle exec rubocop lib/ |