-
Notifications
You must be signed in to change notification settings - Fork 66
72 lines (60 loc) · 1.74 KB
/
server-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
name: server-ci
on:
push:
branches: [main]
paths:
- "server/**"
pull_request:
branches: [main]
paths:
- "server/**"
env:
DB_HOST: localhost
DB_USERNAME: postgres
DB_PASSWORD: postgres
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: multiwoven_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.0
- name: Bundle Install
run: bundle install
working-directory: ./server
- name: Database Setup
run: bundle exec rake db:create db:schema:load --trace
working-directory: ./server
- name: Run RuboCop
run: bundle exec rubocop
working-directory: ./server
- name: Run Tests
run: bundle exec rspec
working-directory: ./server
- name: Install cc-test-reporter
if: github.event_name == 'push'
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
working-directory: ./server
- name: Upload Coverage to Code Climate
if: github.event_name == 'push'
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
./cc-test-reporter before-build
./cc-test-reporter after-build --exit-code $?
working-directory: ./server