-
Notifications
You must be signed in to change notification settings - Fork 16
41 lines (37 loc) · 1.07 KB
/
rspec.yml
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
on: [push, pull_request]
jobs:
rspec:
runs-on: ubuntu-latest
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: "postgres"
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up ruby and restore/install gem dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.3
bundler-cache: true
- name: Restore node dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install node dependencies
run: yarn install --frozen-lockfile
- name: Create database
run: RAILS_ENV=test bundle exec rails db:create
- name: Run tests
run: bundle exec rspec