-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.24 KB
/
ruby.yml
File metadata and controls
49 lines (44 loc) · 1.24 KB
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
name: Ruby
on: [push]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.6-alpine
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install required package
run: |
sudo apt-get update
sudo apt-get -yqq install libmysqlclient-dev libpq-dev libncurses5-dev yarn
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Install gems
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Yarn setup
run: |
yarn add @rails/webpacker@next
bundle exec rails webpacker:install
- name: Run tests
env:
POSTGRES_HOST: localhost
RAILS_ENV: test
run: |
bundle exec rails db:setup
bundle exec rake