name: Exercise tests

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

jobs:
  test:
    name: Ruby ${{ matrix.ruby-version }} - ${{ matrix.os }} - ${{ github.event_name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          # - windows-latest
          # - macOS-latest
        ruby-version: [2.5]

    steps:
      - uses: actions/checkout@v2

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

      # - uses: actions/cache@v2
      #   with:
      #     path: vendor/bundle
      #     key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
      #     restore-keys: |
      #       ${{ runner.os }}-gems-

      - name: Bundle install
        run: |
          # bundle config path vendor/bundle
          bundle install --quiet

      - name: Lint 
        run: rubocop -fs -D

      - name: Test exercises
        run: rake test

name: Exercise tests

on:
  workflow_dispatch:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    name: Ruby ${{ matrix.ruby-version }} - ${{ matrix.os }} - ${{ github.event_name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          # - windows-latest
          # - macOS-latest
        ruby-version: [2.5, 2.6, 2.7, 3.0]

    steps:
      - uses: actions/checkout@v2

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

      - name: Lint
        run: bundle exec rubocop -fs -D

      - name: Test exercises
        run: bundle exec rake test

Fix the tests and use multiple Ruby versions
Fix the tests and use multiple Ruby versions
