name: Verify

on:
  push:
    branches:
      - '*'
  pull_request:
    branches:
      - '*'

jobs:
  test:
    runs-on: ubuntu-16.04
    timeout-minutes: 40

    strategy:
      fail-fast: true
      matrix:
        ruby:
          - 2.5
          - 2.6
          - 2.7
          - 3.0

    env:
      RAILS_ENV: test

    name: Ruby ${{ matrix.ruby }}
    steps:
      - name: Install system dependencies
        run: sudo apt-get install graphviz

      - name: Checkout code
        uses: actions/checkout@v2

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

      - name: Setup bundler
        run: |
          gem install bundler

      - name: Bundle install
        run: |
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3

      - name: Test
        run: |
          bundle exec rake spec
          bundle exec rake yard

      - name: Upload coverage report
        uses: actions/upload-artifact@v2
        with:
          name: coverage-${{ matrix.ruby }}
          path: |
            coverage/
          retention-days: 1

name: Verify

on:
  push:
    branches:
      - '*'
  pull_request:
    branches:
      - '*'

jobs:
  test:
    runs-on: ubuntu-18.04
    timeout-minutes: 40

    strategy:
      fail-fast: true
      matrix:
        ruby:
          - 2.5
          - 2.6
          - 2.7
          - 3.0

    env:
      RAILS_ENV: test

    name: Ruby ${{ matrix.ruby }}
    steps:
      - name: Install system dependencies
        run: sudo apt-get install graphviz

      - name: Checkout code
        uses: actions/checkout@v2

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

      - name: Test
        run: |
          bundle exec rake spec
          bundle exec rake yard

      - name: Upload coverage report
        uses: actions/upload-artifact@v2
        with:
          name: coverage-${{ matrix.ruby }}
          path: |
            coverage/
          retention-days: 1

Update Ubuntu version & Ruby Setup action
Update Ubuntu version & Ruby Setup action
