Skip to content

Merge remote-tracking branch 'upstream/master' #34

Merge remote-tracking branch 'upstream/master'

Merge remote-tracking branch 'upstream/master' #34

Workflow file for this run

name: CI
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0']
services:
postgres:
# Docker Hub image
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Create database
run: |
psql -c 'create database pg_search_test;' -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U postgres >/dev/null
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
PGPASSWORD: postgres
- name: Run tests
run: bundle exec rspec
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
- name: Run RuboCop
run: bundle exec rubocop