-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (72 loc) · 2 KB
/
ruby.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
name: Ruby
on:
push:
branches: [ develop, staging, main ]
pull_request: {}
env:
DATABASE_URL: postgres://postgres:[email protected]:5432/test
MAILERSEND_API_TOKEN: ${{ secrets.MAILERSEND_API_TOKEN }}
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Run rubocop
uses: reviewdog/action-rubocop@master
with:
github_token: ${{ secrets.github_token }}
rubocop_extensions: 'rubocop-rails rubocop-performance rubocop-rspec rubocop-graphql'
security:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: bundler-audit
run: bundle exec bundle audit check --update
- name: Brakeman
run: bundle exec brakeman
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# TODO: uncomment this if you use jobs in your tests
# redis:
# image: redis
# ports:
# - 6379:6379
# options: --entrypoint redis-server
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Update apt repositories
run: sudo apt-get update
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true
- name: Create database
run: bundle exec bin/rails db:create db:migrate RAILS_ENV=test
- name: Run tests
run: bundle exec rspec
- name: SimpleCov+ Action
uses: joshmfrankel/[email protected]
with:
minimum_suite_coverage: 80
github_token: ${{ secrets.GITHUB_TOKEN }}