-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (68 loc) · 1.8 KB
/
ruby-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: rails-CI
on:
pull_request:
push:
branches: [master]
jobs:
linters:
name: Ruby Linters
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
- name: Ruby gem cache
uses: actions/cache@v1
with:
path: backend/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
cd backend
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run linters
run: |
cd backend
bundle exec rubocop --parallel
tests:
name: Ruby Tests
runs-on: ubuntu-latest
env:
JWT_SECRET: "supersecretforci"
JWT_ISSUER: "https://github.com/hub-usp-inovacao/platform"
services:
mongo:
image: mongo
ports:
- 27017:27017
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
- name: Ruby gem cache
uses: actions/cache@v1
with:
path: backend/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
cd backend
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Define Mongoid config
run: mv backend/config/mongoid.ci.yml backend/config/mongoid.yml
- name: Run tests
run: |
cd backend
bundle exec rspec