name: Ruby

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    services:
      postgres:
        image: postgres:11
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        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
      run: |
        sudo apt-get install libpq-dev redis
        gem install bundler
        bundle install --jobs 4 --retry 3
        mv spec/dummy/config/database.yml spec/dummy/config/database.yml.orig
        bundle exec rake db:create
        bundle exec rake db:schema:load
        yarn install
        bundle exec rake app:sunspot:solr:start RAILS_ENV=test
        bundle exec rake
      env:
        DATABASE_URL: postgres://postgres:postgres@localhost:5432/dummy_test
        RAILS_ENV: test

name: Ruby

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    services:
      postgres:
        image: postgres:11
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        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
      run: |
        sudo apt-get install libpq-dev redis
        gem install bundler
        bundle install --jobs 4 --retry 3
        mv spec/dummy/config/database.yml spec/dummy/config/database.yml.orig
        bundle exec rake db:create
        bundle exec rake db:schema:load
        yarn install
        bundle exec rake app:sunspot:solr:start
        bundle exec rake
      env:
        DATABASE_URL: postgres://postgres:postgres@localhost:5432/dummy_test
        RAILS_ENV: test

Revert "add RAILS_ENV to solr"
Revert "add RAILS_ENV to solr"

This reverts commit 8eb1cf9910856b206b434c88e3b7f2ff40552d42.
