name: CI

on: [push, pull_request]

jobs:
  build:
    name: build (${{ matrix.ruby }} / ${{ matrix.os }})
    strategy:
      matrix:
        ruby: [ 3.1, '3.0', 2.7, 2.6, 2.5, 2.4, head, truffleruby ]
        os: [ ubuntu-latest, macos-latest ]
        exclude:
          - ruby: 2.4
            os: macos-latest
          - ruby: 2.5
            os: macos-latest
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v3
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
    - run: bundle install --jobs 4 --retry 3
    - name: Run test
      run: rake test
