-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (44 loc) · 1.12 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
name: Tests
on:
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v2
- name: Setup Ruby 2.6.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.6
- run: ruby -v
- name: Cache Gems
uses: actions/[email protected]
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-
- name: Install and configure bundler
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Setup test DB
run: |
cp config/database.github-actions.yml config/database.yml
bundle exec rake db:setup
env:
RAILS_ENV: test
- name: Run rake
run: bundle exec rake