-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.15 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
name: Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.6-alpine
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Ruby version specified in `.ruby-version`
uses: ruby/setup-ruby@v1
with:
working-directory: './spec/dummy-app'
- name: Install required apt packages
run: |
sudo apt-get -y install libpq-dev
- name: Setup cache key and directory for gems cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-use-ruby-${{ hashFiles('**/Gemfile.lock') }}
- name: Bundle install
run: |
bundle config path vendor/bundle
cd spec/dummy-app/
bundle install --jobs 4 --retry 3
- name: Rails test
run: |
cd spec/dummy-app/
bundle exec rails db:setup
bundle exec rspec