name: Ruby

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    services:
      redis:
        image: redis
        ports:
        - 6379:6379
        options: --entrypoint redis-server

    strategy:
      fail-fast: false
      matrix:
        ruby: [2.4, 2.5, 2.6, 2.7]
    steps:
    - uses: actions/checkout@v2

    - name: Setup Ruby ${{ matrix.ruby }}
      uses: eregon/use-ruby-action@v1
      with:
        ruby-version: ${{ matrix.ruby }}

    - uses: actions/cache@v1
      with:
        path: vendor/bundle
        key: ${{ runner.os }}-ruby-version-${{ matrix.ruby }}-gems-${{ hashFiles('**/*[Gg]em[fs][ip][le][ec]') }}
        restore-keys: |
          ${{ runner.os }}-ruby-version-${{ matrix.ruby }}-gems-

    - name: Install dependencies
      run: |
        gem install bundler
        bundle config path vendor/bundle
        bundle install --jobs 4 --retry 3

    - name: Test with RSpec
      env:
        REDIS_HOST: redis
        REDIS_PORT: ${{ job.services.redis.ports[6379] }}
      run: |
        bundle exec rspec spec

name: Ruby

on: [push]

jobs:
  build:

    runs-on: ${{ matrix.os }}

    services:
      redis:
        image: redis
        ports:
        - 6379:6379
        options: --entrypoint redis-server

    strategy:
      fail-fast: false
      matrix:
        ruby: [2.4, 2.5, 2.6, 2.7]
        os: [ubuntu-latest, macos-latest]
    steps:
    - uses: actions/checkout@v2

    - name: Setup Ruby ${{ matrix.ruby }}
      uses: eregon/use-ruby-action@v1
      with:
        ruby-version: ${{ matrix.ruby }}

    - uses: actions/cache@v1
      with:
        path: vendor/bundle
        key: ${{ matrix.os }}-ruby-version-${{ matrix.ruby }}-gems-${{ hashFiles('**/*[Gg]em[fs][ip][le][ec]') }}
        restore-keys: |
          ${{ matrix.os }}-ruby-version-${{ matrix.ruby }}-gems-

    - name: Install dependencies
      run: |
        gem install bundler
        bundle config path vendor/bundle
        bundle install --jobs 4 --retry 3

    - name: Test with RSpec
      env:
        REDIS_HOST: redis
        REDIS_PORT: ${{ job.services.redis.ports[6379] }}
      run: |
        bundle exec rspec spec

Add macOS to the build matrix
Add macOS to the build matrix
