-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 1.69 KB
/
ci.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
54
55
56
57
58
59
60
61
62
63
64
65
# Ruby Workflow to test application
# Scott Goyette
# Date: 05/25/2020
# Email: scott.goyette@rubypythmore.com
env:
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_USER: postgres
POSTGRES_HOST: localhost
RAILS_ENV: test
name: CI/CD for Federation Manager
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
with:
ruby-version: 2.7.1
- name: Install dependent libraries
run: |
sudo apt-get -yqq install libpq-dev
- name: Bundle install
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Yarn Install
run: bin/rails yarn:install
- name: Compile Assets
shell: bash
run: |
if [[ ! -d public/packs-test ]]; then
bundle exec rails webpacker:compile
else
echo "No need to compile assets."
fi
- name: Setup postgres database
run: bundle exec rails db:setup
- name: Run Tests
run: |
bundle exec rails test
bundle exec rails test:system