-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (47 loc) · 1.14 KB
/
rails.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
42
43
44
45
46
47
48
49
50
51
name: RSpec and Rubocop checks
on:
# Runs on pushes and pull requests targeting main or develop branches
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
rspec-rubocop:
# Set the action to run in the `api` sub directory
defaults:
run:
working-directory: ./api
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: api
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
- name: Install dependencies
run: bundle install
- name: Setup DB and run RSpec
env:
RAILS_ENV: test
DB_USER: api
DB_PASSWORD: postgres
PGHOST: localhost
PGPORT: 5432
run: |
bundle exec rails db:setup
bundle exec rspec
- name: Run Rubocop
run: bundle exec rubocop