-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.12 KB
/
tests.yml
File metadata and controls
41 lines (39 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Rspec Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports: ['5432:5432']
env:
POSTGRES_USERNAME: 'postgres'
POSTGRES_PASSWORD: 'test'
POSTGRES_DB: 'postgres'
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: install PostgreSQL client
run: sudo apt-get install libpq-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build App
env:
DATABASE_URL: postgresql://postgres:test@127.0.0.1:5432/postgres?encoding=utf8&pool=5&timeout=5000
run: RAILS_ENV=test bin/rails db:setup
- name: Run Rspec Unit Tests
env:
DATABASE_URL: postgresql://postgres:test@127.0.0.1:5432/postgres?encoding=utf8&pool=5&timeout=5000
run: RAILS_ENV=test bin/rails spec