-
-
Notifications
You must be signed in to change notification settings - Fork 24
53 lines (45 loc) · 1.09 KB
/
test.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
52
53
name: Ruby
on:
push:
branches:
- main
- 'releases/*'
pull_request:
branches:
- main
- 'releases/*'
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_DB: rails_bump_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
HOST: localhost
REDIS_HOST: localhost:6379
DATABASE_URL: postgres://postgres:postgres@localhost:5432/rails_bump_test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Install dependencies
run: bundle install
- name: Set up the database
run: |
bin/rails db:create
bin/rails db:schema:load
bin/rails db:test:prepare
- name: Run tests
run: bundle exec rspec spec