---
name: Unit tests

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

env:
  CI: true

jobs:
  linux_unit_tests:
    name: Ruby version
    strategy:
      matrix:
        ruby:
          - 2.3
          - 2.7
          - 3.0
          - 'jruby-9.2.19.0'
    runs-on: ubuntu-18.04
    steps:
      - name: Checkout current PR
        uses: actions/checkout@v2

      - name: Rspec checks
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - run: gem update bundler
      - run: bundle install --jobs 3 --retry 3
      - run: bundle exec rake spec_random
      - run: bundle exec rake spec_integration

  windows_unit_tests:
    runs-on: windows-2019
    steps:
      - name: Checkout current PR
        uses: actions/checkout@v2

      - name: Rspec checks
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7
      - run: gem update bundler
      - run: bundle install --jobs 3 --retry 3
      - run: bundle exec rake spec_random
      - run: bundle exec rake spec_integration

---
name: Unit tests

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

env:
  CI: true

jobs:
  linux_unit_tests:
    name: Ruby version
    strategy:
      matrix:
        ruby:
          - 2.3
          - 2.7
          - 3.0
          - jruby
    runs-on: ubuntu-18.04
    steps:
      - name: Checkout current PR
        uses: actions/checkout@v2

      - name: Rspec checks
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - run: gem update bundler
      - run: bundle install --jobs 3 --retry 3
      - run: bundle exec rake spec_random
      - run: bundle exec rake spec_integration

  windows_unit_tests:
    runs-on: windows-2019
    steps:
      - name: Checkout current PR
        uses: actions/checkout@v2

      - name: Rspec checks
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7
      - run: gem update bundler
      - run: bundle install --jobs 3 --retry 3
      - run: bundle exec rake spec_random
      - run: bundle exec rake spec_integration

Revert "(maint) Pin jruby version in GitHub Actions workflow"
Revert "(maint) Pin jruby version in GitHub Actions workflow"
