-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (72 loc) · 2.53 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
77
78
79
80
81
82
name: Github Testing
on: [push]
jobs:
test:
services:
postgres:
image: postgres:15
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: password
POSTGRES_USERNAME: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
ruby: [ '3.2.0' ]
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: config bundler
run: |
bundle config set without 'development staging production'
bundle config set deployment '[secure]'
bundle env
head -n1 $(which bundle)
- name: Copy config files
run: |
cp config/application.yml.example config/application.yml
cp config/database_ci.yml config/database.yml
- name: Install dependencies
run: |
bundle install --jobs 4 --retry 3 --path vendor/bundle
- name: Setup database
run: |
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:schema:load
bundle exec rake db:seed
bundle exec rails assets:precompile
- name: Run Tests with Code Climate
uses: paambaati/[email protected]
env:
PG_DATABASE: postgres
PG_HOST: localhost
PG_USER: postgres
PG_PASSWORD: password
PG_PORT: ${{ job.services.postgres.ports[5432] }}
RAILS_ENV: test
COVERAGE: true
DISABLE_SPRING: 1
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: bundle exec rspec spec
debug: true
# run: |
# # cp config/application.yml.example config/application.yml
# # cp config/database_ci.yml config/database.yml
# bundle exec rake db:create
# bundle exec rake db:migrate
# bundle exec rake db:schema:load
# bundle exec rake db:seed
# bundle exec rails assets:precompile
# bundle exec rspec spec
- name: Dependabot
if: ${{ github.event.label.name == 'dependencies' }}
run: bundle exec rails assets:precompile