Skip to content

Trigger CI build

Trigger CI build #47

Workflow file for this run

name: Ruby tests
on: [push, pull_request]
jobs:
rspec-test:
name: Rspec suite
runs-on: ubuntu-latest
services:
# Docker services, use images from Docker hub
# Using dockers health-check to wait for services to start,
# see https://ryaneschinger.com/blog/using-docker-native-health-checks/
postgres:
image: postgres:12.5
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 2s
--health-retries 15
strategy:
fail-fast: false
matrix:
ruby: [2.7, 3.1]
activerecord: [">= 5, < 6", ">= 6, < 7", ">= 7, < 7.1"]
pg: ["~> 0.2", "~> 1.4"]
exclude:
- activerecord: ">= 5, < 6"
ruby: 3.1
pg: "~> 0.2"
- activerecord: ">= 5, < 6"
ruby: 3.1
pg: "~> 1.4"
- activerecord: ">= 6, < 7"
ruby: 3.1
pg: "~> 0.2"
- activerecord: ">= 7, < 7.1"
ruby: 3.1
pg: "~> 0.2"
- activerecord: ">= 6, < 7"
ruby: 2.7
pg: "~> 0.2"
- activerecord: ">= 7, < 7.1"
ruby: 2.7
pg: "~> 0.2"
env:
SIMPLE_SQL_ACTIVERECORD_SPECS: "${{ matrix.activerecord }}"
SIMPLE_SQL_PG_SPECS: "${{ matrix.pg }}"
PG_USER: postgres
PG_PW: postgres
PG_PORT: 5432
steps:
- name: Clone repo into CI env
uses: actions/checkout@v2
- name: Install Ruby and bundler and bundle project
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: false
- name: Install postgres client lib
run: sudo apt-get install libpq-dev
- name: Show PostgreSQL server version
run: PGPASSWORD=${{ env.PG_PW }} psql -U ${{ env.PG_USER }} -h 127.0.0.1 -p ${{ env.PG_PORT }} -c 'SELECT version();'
- name: Create Test DB
run: |
PGPASSWORD=${{ env.PG_PW }} createdb -U ${{ env.PG_USER }} -h 127.0.0.1 -p ${{ env.PG_PORT }} simple-sql-test
- name: Install gem dependencies
run: bundle install --jobs 4 --retry 3
- name: Run Configure
run: cp config/database.yml.sample config/database.yml
- name: Run tests
run: bundle exec rspec
- name: Run Rubocop linting
run: bundle exec rubocop --color --parallel