name: Build on: push: branches: - master pull_request: jobs: rspec: runs-on: ubuntu-latest env: BUNDLE_JOBS: 4 BUNDLE_RETRY: 3 CI: true RAILS_ENV: test DATABASE_URL: postgres://postgres:postgres@localhost:5432 strategy: fail-fast: false matrix: ruby: ["2.7"] postgres: ["12"] gemfile: [ "gemfiles/rails61.gemfile" ] fx: ["false"] include: - ruby: "3.0" postgres: "13" gemfile: "gemfiles/railsmaster.gemfile" fx: "false" - ruby: "2.6" postgres: "12" gemfile: "gemfiles/rails61.gemfile" fx: "false" - ruby: "2.6" postgres: "12" gemfile: "gemfiles/rails6.gemfile" fx: "false" - ruby: "2.5" postgres: "11" gemfile: "gemfiles/rails52.gemfile" fx: "false" services: postgres: image: postgres:${{ matrix.postgres }} ports: ["5432:5432"] env: POSTGRES_PASSWORD: postgres options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v2 - uses: actions/cache@v1 with: path: /home/runner/bundle key: bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles(matrix.gemfile) }}-${{ hashFiles('**/*.gemspec') }} restore-keys: | bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}- - name: Install system deps run: | sudo apt-get update sudo apt-get -yqq install libpq-dev - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Bundle install run: | bundle config path /home/runner/bundle bundle config --global gemfile ${{ matrix.gemfile }} bundle install bundle update - name: Prepare test database run: | bundle exec rake dummy:db:create bundle exec rake dummy:db:migrate:reset - name: Run RSpec env: USE_FX: ${{ matrix.fx }} run: | bundle exec rspec -f d --force-color