-
Notifications
You must be signed in to change notification settings - Fork 44
108 lines (100 loc) · 2.97 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
on: [pull_request]
env:
TESTOPTS: --verbose
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Setup
run: |
gem install bundler -v 2.4.22
bundle install --jobs=3 --retry=3
- name: Run rubocop
run: bundle exec rubocop
test:
runs-on: ubuntu-latest
needs: rubocop
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.7.0
- 3.0.0
- 3.2.0
concurrent_ruby_ext:
- 'true'
- 'false'
db:
- postgresql
- mysql
- sqlite3
include:
- db: postgresql
conn_string: postgres://postgres@localhost/travis_ci_test
- db: mysql
conn_string: mysql2://[email protected]/travis_ci_test
- db: sqlite3
conn_string: sqlite:/
exclude:
- db: mysql
ruby_version: 3.0.0
- db: mysql
ruby_version: 3.2.0
- db: mysql
concurrent_ruby_ext: 'true'
- db: sqlite3
ruby_version: 3.0.0
- db: sqlite3
ruby_version: 3.2.0
- db: sqlite3
concurrent_ruby_ext: 'true'
- db: postgresql
ruby_version: 3.0.0
concurrent_ruby_ext: 'true'
- db: postgresql
ruby_version: 3.2.0
concurrent_ruby_ext: 'true'
services:
postgres:
image: postgres:12.1
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_DB: travis_ci_test
mariadb:
image: mariadb:10
ports: ['3306:3306']
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: travis_ci_test
redis:
image: redis:latest
ports: ['6379:6379']
env:
DB: ${{ matrix.db }}
DB_CONN_STRING: ${{ matrix.conn_string }}
CONCURRENT_RUBY_EXT: "${{ matrix.concurrent_ruby_ext }}"
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Install dependencies
run: .github/install_dependencies.sh
- name: Run tests
run: bundle exec rake test