-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (49 loc) · 1.31 KB
/
Copy pathruby.yml
File metadata and controls
61 lines (49 loc) · 1.31 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
50
51
52
53
54
55
56
57
58
59
60
61
name: CI/CD
on: [push]
jobs:
static_analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Standard code linter
run: |
bin/standardrb --format progress
- name: Bundler audit
run: |
bin/bundler-audit --update
- name: Brakeman
run: |
bin/brakeman -q
tests:
name: Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10ms --health-timeout 500ms --health-retries 5
env:
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Create database config
run: cp config/database.postgres.yml config/database.yml
- name: Prepare DB and run test suite
env:
PGHOST: 127.0.0.1
PGUSER: postgres
RAILS_ENV: test
run: |
bin/rails db:test:prepare
bin/rspec