-
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 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
name: Tests
on: push
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14-alpine
ports: ['5432:5432']
env:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: postgres://test:test@localhost:5432/test
CI: "true"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Ruby based on .ruby-version
uses: ruby/setup-ruby@v1
- name: Restore bundle cache
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{runner.os}}-gems-${{hashFiles('**/Gemfile.lock')}}
restore-keys: ${{runner.os}}-gems-
- name: Bundle install
run: |
gem install bundler
bundle install
- name: Setup database
run: bundle exec rake db:create db:schema:load
- name: Run tests
run: bin/rspec