name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest

    services:
      db:
        image: postgres:9.5
        ports: ['5432:5432']
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
    - uses: actions/checkout@v1
    - name: Set up Ruby 2.6
      uses: actions/setup-ruby@v1
      with:
        ruby-version: 2.6.x
    - name: Build and test with Rake
      env:
        RAILS_ENV: test
        DATABASE_URL: postgres://postgres:@localhost:5432/test
      run: |
        sudo apt-get -yqq install libpq-dev
        sudo apt-get install postgresql-client
        gem install bundler
        bundle install --jobs 4 --retry 3
        bundle exec rake db:create
        bundle exec rake db:migrate
        bundle exec rake test

name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest

    services:
      db:
        image: postgres:9.5
        ports: ['5432:5432']
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
    - uses: actions/checkout@v1
    - name: Set up Ruby 2.6
      uses: actions/setup-ruby@v1
      with:
        ruby-version: 2.6.x
    - name: Install Dependencies
      run: |
        sudo apt-get -yqq install libpq-dev
        sudo apt-get install postgresql-client
        gem install bundler
        bundle install --jobs 4 --retry 3
    - name: Migrate Database
      env:
        RAILS_ENV: test
        DATABASE_URL: postgres://postgres:@localhost:5432
      run: |
        bundle exec rake db:create
        bundle exec rake db:migrate
    - name: Test
      env:
        RAILS_ENV: test
        DATABASE_URL: postgres://postgres:@localhost:5432
      run: |
        bundle exec rake test

Split installing dependencies and testing in Github Action
Split installing dependencies and testing in Github Action
