Skip to content

Commit 36867c7

Browse files
committed
Add CI
1 parent 4ea4901 commit 36867c7

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
on: [push]
3+
4+
jobs:
5+
linters:
6+
name: Linters
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v2
11+
- name: Setup Ruby and install gems
12+
uses: ruby/setup-ruby@v1
13+
with:
14+
bundler-cache: true
15+
- name: Run linters
16+
run: |
17+
bin/rubocop --parallel
18+
- name: Run security checks
19+
run: |
20+
bin/bundler-audit --update
21+
22+
tests:
23+
name: Tests
24+
runs-on: ubuntu-latest
25+
services:
26+
postgres:
27+
image: postgres:13
28+
env:
29+
POSTGRES_USER: myapp
30+
POSTGRES_DB: myapp_test
31+
POSTGRES_PASSWORD: ""
32+
ports: ["5432:5432"]
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v2
36+
- name: Setup Ruby and install gems
37+
uses: ruby/setup-ruby@v1
38+
with:
39+
bundler-cache: true
40+
- name: Setup test database
41+
env:
42+
RAILS_ENV: test
43+
PGHOST: localhost
44+
PGUSER: myapp
45+
run: |
46+
bin/rails db:setup
47+
- name: Run tests
48+
run: bin/rspec

0 commit comments

Comments
 (0)