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

jobs:
  test:
    runs-on: ${{ matrix.os }}
    name: Ruby ${{matrix.ruby}} | OS ${{matrix.os}}

    strategy:
      fail-fast: false
      matrix:
        ruby: [ 2.7, 2.6, 2.5, jruby ]
        os: [ ubuntu-latest, macos-latest, windows-latest ]

    steps:
    - uses: actions/checkout@v2
    - uses: actions/cache@v1
      with:
        path: vendor/bundle
        key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
        restore-keys: |
          bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-

    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}

    - name: bundle install
      run: |
        bundle config path vendor/bundle
        bundle install --jobs 4 --retry 3

    - name: Run tests
      run: bin/rspec

    - name: Run linter
      run: bin/rubocop

name: CI

on:
  push:
    branches:
      - main
      - master
  pull_request:
    branches:
      - main
      - master

jobs:
  test:
    runs-on: ${{ matrix.os }}
    name: Ruby ${{matrix.ruby}} | OS ${{matrix.os}}
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - '3.0'
          - 2.7
          - 2.6
          - jruby
          # - truffleruby
        os:
          - ubuntu-20.04
          - macos-latest
          - windows-latest
    steps:
      - uses: actions/checkout@v2
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - run: bin/rspec

  lint:
    runs-on: ubuntu-20.04
    name: Lint
    steps:
      - uses: actions/checkout@v2
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.0'
          bundler-cache: true
      - run: bin/rubocop

Update build matrix and jobs
Update build matrix and jobs
