name: Tests

on:
  push:
  pull_request:
    branches: [ master ]
  schedule:
    - cron: '0 0 * * *'

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ruby:
          - '2.1'
          - '2.2'
          - '2.3'
          - '2.4'
          - '2.5'
          - '2.6'
          - '2.7'
          - '3.0'
          - 'ruby-head'
          - 'jruby-head'
          - 'truffleruby-head'

    steps:
      - uses: actions/checkout@v1

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

      - name: Test
        run: |
          bundle exec rake
