-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.37 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
name: Ruby
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
jobs:
test:
name: Test
environment: alljobs
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12-alpine
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -yqq install libpq-dev
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.5
bundler-cache: true
- name: Install Ruby dependencies
run: bundle install --jobs 4 --retry 3
- name: Analyze code
run: bundle exec rubocop
- name: Run tests
env:
RAILS_ENV: test
PGHOST: localhost
DISABLE_SPRING: 1
run: |
bundle exec rails db:schema:load
bundle exec rspec --format progress
- name: Publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}