mLewisLogic/saddle

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby

on: [pull_request, push]

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ruby-version: [2.6, 2.7, '3.0', 3.1]
        gemfile:
          - activesupport_3.2
          - activesupport_4.0
          - activesupport_4.1
          - activesupport_4.2
          - activesupport_5.0
          - activesupport_5.1
          - activesupport_5.2
          - activesupport_6.0
          - activesupport_6.1
          - activesupport_7.0
          - activesupport_7.1
          - faraday_0.x
          - faraday_1
          - faraday_2
        exclude:
        - ruby-version: 2.6
          gemfile: activesupport_7.1
        - ruby-version: 2.6
          gemfile: activesupport_7.0
        - ruby-version: '3.0'
          gemfile: activesupport_4.1
        - ruby-version: 3.1
          gemfile: activesupport_4.1
        - ruby-version: '3.0'
          gemfile: faraday_0.x
        - ruby-version: 3.1
          gemfile: faraday_0.x
    steps:
    - uses: actions/checkout@v3

    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby-version }}
        bundler-cache: true # runs 'bundle install' and caches installed gems automatically

    - name: Generate Appraisal gemfiles
      run: bundle exec appraisal generate

    - name: Install dependencies
      env:
        BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
      run: bundle install

    - name: Run rspec
      env:
        BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
      run: bundle exec rspec