-
Notifications
You must be signed in to change notification settings - Fork 82
195 lines (189 loc) · 5.27 KB
/
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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: CI
on:
push:
branches:
- master
- 1-2
- 1-1
- 1-0
- 0-8
pull_request:
branches:
- master
- 1-2
- 1-1
- 1-0
- 0-8
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
name: ${{ matrix.feature }} ruby-${{ matrix.ruby }} ${{ matrix.orm.name }}-${{ matrix.orm.version}} ${{ matrix.database }}
strategy:
fail-fast: false
matrix:
ruby:
- '3.2'
- '3.1'
- '3.0'
database:
- 'sqlite3'
- 'mysql'
- 'postgres'
orm:
- name: 'active_record'
version: '6.1'
- name: 'active_record'
version: '7.0'
- name: 'active_record'
version: '7.1'
- name: 'sequel'
version: '5'
experimental: [false]
feature: ['unit']
include:
- ruby: '3.2'
feature: 'unit'
orm:
experimental: false
- ruby: '3.1'
feature: 'unit'
orm:
experimental: false
- ruby: '3.0'
feature: 'unit'
orm:
experimental: false
- ruby: '3.2'
feature: 'rails'
orm:
name: 'active_record'
version: '7.0'
database: 'sqlite3'
experimental: false
- ruby: '3.2'
feature: 'performance'
experimental: false
- ruby: '3.2'
feature: 'i18n_fallbacks'
experimental: false
- ruby: '3.2'
database: 'sqlite3'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.2'
database: 'mysql'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.2'
database: 'postgres'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.1'
feature: 'rails'
orm:
name: 'active_record'
version: '7.0'
database: 'sqlite3'
experimental: false
- ruby: '3.1'
feature: 'performance'
experimental: false
- ruby: '3.1'
feature: 'i18n_fallbacks'
experimental: false
- ruby: '3.1'
database: 'sqlite3'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.1'
database: 'mysql'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.1'
database: 'postgres'
feature: 'unit'
orm:
name: 'active_record'
version: 'edge'
experimental: true
- ruby: '3.0'
feature: 'rails'
orm:
name: 'active_record'
version: '7.0'
database: 'sqlite3'
experimental: false
- ruby: '3.0'
feature: 'performance'
experimental: false
- ruby: '3.0'
feature: 'i18n_fallbacks'
experimental: false
env:
DB: ${{ matrix.database }}
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
ORM: ${{ matrix.orm.name }}
ORM_VERSION: ${{ matrix.orm.version }}
MYSQL_PASSWORD: root
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
RAILS_ENV: test
FEATURE: ${{ matrix.feature }}
services:
postgres:
image: postgres:11.5
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:5.7
ports: ["3306:3306"]
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
env:
MYSQL_ROOT_PASSWORD: root
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update packages
run: sudo apt-get update
- name: Install Sqlite
run: sudo apt-get install libsqlite3-dev -y
if: matrix.database == 'sqlite3'
- name: Install Postgres
run: sudo apt-get install libpq-dev postgresql-client -y
if: matrix.database == 'postgres'
- id: cache-bundler
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-${{ matrix.orm.name }}-${{ matrix.orm.version }}-${{ matrix.feature }}-${{ hashFiles('mobility.gemspec') }}-${{ hashFiles('Gemfile') }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install latest Bundler
run: gem install bundler --no-document
- name: Install dependencies
run: bundle install
- name: Setup test db
run: bundle exec rake db:create db:up
if: matrix.database
- name: Run tests
run: bundle exec rake