name: Ruby gem rspec test

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ruby:
          - '2.5.x'
          - '2.6.x'
          - '2.7.x'

    steps:
    - name: Checkout current branch
      uses: actions/checkout@v2

    - name: Install sqlite3 on system
      run: |
        sudo apt-get install libsqlite3-dev

    - name: Setup Ruby
      uses: actions/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
    
    - name : Install dependency
      run: |
        bundle install
        
    - name: Run appraisal to install different active records version
      run: |
        bundle exec appraisal
        
    - name: Run rspec test across active record 5 and 6
      run: |
        bundle exec appraisal activerecord-6.0 rspec
        bundle exec appraisal activerecord-5.0 rspec

    # active record 4 is not compatible with ruby 2.7 due to BigDecimal changes
    - name: Run rspec test on active record 4
      run: |
        bundle exec appraisal activerecord-4.1 rspec
      exclude:
        - ruby: '2.7.x'
name: Ruby gem rspec test

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ruby:
          - '2.5.x'
          - '2.6.x'
          - '2.7.x'
        activerecord:
          - '4.1'
          - '5.0'
          - '6.0'
        exclude:
        # active record 4.1 is not compatible with ruby 2.7 due to BigDecimal changes
        - ruby: '2.7.x'
          activerecord: '4.1' 

    steps:
    - name: Checkout current branch
      uses: actions/checkout@v2

    - name: Install sqlite3 on system
      run: |
        sudo apt-get install libsqlite3-dev

    - name: Setup Ruby
      uses: actions/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
    
    - name : Install dependency
      run: |
        bundle install
        
    - name: Run appraisal to install different active records version
      run: |
        bundle exec appraisal
        
    - name: Run rspec test across active record
      run: |
        bundle exec appraisal activerecord-${{ matrix.activerecord }} rspec

    
Exclude active record 4 ruby 2.7 combination in test
Exclude active record 4 ruby 2.7 combination in test

Exclude active record 4 ruby 2.7 combination in test
