name: test

on:
  push:
    branches:
      - master
      - /.+-stable$/

  pull_request:

jobs:
  test:
    runs-on: ubuntu-20.04

    strategy:
      fail-fast: false

      matrix:
        ruby:
          - 2.3.8
          - 2.4.10
          - 2.5.8
          - 2.6.6
          - 2.7.1
          - 3.0.0
          - 3.1.2
          - jruby-9.2.11.1

    env:
      LANG: en_US.UTF-8

    steps:
      - uses: actions/checkout@v2

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true

      - name: Run tests
        run: bundle exec rake
        continue-on-error: ${{ matrix.ruby == 'ruby-head' }}
