-
Notifications
You must be signed in to change notification settings - Fork 336
239 lines (232 loc) · 8.04 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: Test (Ruby ${{ matrix.ruby }}, Gemfile ${{ matrix.gemfile }})
runs-on: ubuntu-${{ matrix.ubuntu }}
strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.2', '3.3']
gemfile:
- gemfiles/mysql2/7-1.gemfile
- gemfiles/postgresql/7-1.gemfile
- gemfiles/sqlite3/7-1.gemfile
- gemfiles/trilogy/7-1.gemfile
- gemfiles/mysql2/7-2.gemfile
- gemfiles/postgresql/7-2.gemfile
- gemfiles/sqlite3/7-2.gemfile
- gemfiles/trilogy/7-2.gemfile
ubuntu: ['latest']
include:
#
# Current older ruby
#
- ruby: '2.7'
gemfile: gemfiles/mysql2/7-1.gemfile
ubuntu: latest
- ruby: '2.7'
gemfile: gemfiles/postgresql/7-1.gemfile
ubuntu: latest
- ruby: '2.7'
gemfile: gemfiles/sqlite3/7-1.gemfile
ubuntu: latest
- ruby: '2.7'
gemfile: gemfiles/trilogy/7-1.gemfile
ubuntu: latest
- ruby: '3.0'
gemfile: gemfiles/mysql2/7-1.gemfile
ubuntu: latest
- ruby: '3.0'
gemfile: gemfiles/postgresql/7-1.gemfile
ubuntu: latest
- ruby: '3.0'
gemfile: gemfiles/sqlite3/7-1.gemfile
ubuntu: latest
- ruby: '3.0'
gemfile: gemfiles/trilogy/7-1.gemfile
ubuntu: latest
#
# The past
#
# EOL Active Record
# Rails 3.2 was maintained longer and is ruby 2.2 compatible
- ruby: '2.2'
gemfile: gemfiles/postgresql/3-2.gemfile
ubuntu: '20.04'
- ruby: '2.2'
gemfile: gemfiles/sqlite3/3-2.gemfile
ubuntu: '20.04'
# Rails <= 4.0 was only compatible with ruby 2.0
# The test were running, but there are known incompatibilites
- ruby: 2.0.0
gemfile: gemfiles/postgresql/3-0.gemfile
ubuntu: '20.04'
- ruby: 2.0.0
gemfile: gemfiles/sqlite3/3-0.gemfile
ubuntu: '20.04'
- ruby: 2.0.0
gemfile: gemfiles/postgresql/3-1.gemfile
ubuntu: '20.04'
- ruby: 2.0.0
gemfile: gemfiles/sqlite3/3-1.gemfile
ubuntu: '20.04'
- ruby: 2.0.0
gemfile: gemfiles/postgresql/4-0.gemfile
ubuntu: '20.04'
- ruby: 2.0.0
gemfile: gemfiles/sqlite3/4-0.gemfile
ubuntu: '20.04'
# Rails 4.1 was only compatible with ruby 2.1
- ruby: '2.1'
gemfile: gemfiles/postgresql/4-1.gemfile
ubuntu: '20.04'
- ruby: '2.1'
gemfile: gemfiles/sqlite3/4-1.gemfile
ubuntu: '20.04'
# Rails 4.2 was EOL with the release of 6.0 and compatible with ruby 2.4
- ruby: '2.4'
gemfile: gemfiles/mysql2/4-2.gemfile
ubuntu: '20.04'
- ruby: '2.4'
gemfile: gemfiles/postgresql/4-2.gemfile
ubuntu: '20.04'
- ruby: '2.4'
gemfile: gemfiles/sqlite3/4-2.gemfile
ubuntu: '20.04'
# Rails 5.0 was EOL with the release of 5.2 and compatible with ruby 2.4
- ruby: '2.4'
gemfile: gemfiles/mysql2/5-0.gemfile
ubuntu: '20.04'
- ruby: '2.4'
gemfile: gemfiles/postgresql/5-0.gemfile
ubuntu: '20.04'
- ruby: '2.4'
gemfile: gemfiles/sqlite3/5-0.gemfile
ubuntu: '20.04'
# Rails 5.1 was EOL with the release of 6.0 and compatible with ruby 2.5
- ruby: '2.5'
gemfile: gemfiles/mysql2/5-1.gemfile
ubuntu: '20.04'
- ruby: '2.5'
gemfile: gemfiles/postgresql/5-1.gemfile
ubuntu: '20.04'
- ruby: '2.5'
gemfile: gemfiles/sqlite3/5-1.gemfile
ubuntu: '20.04'
# Rails 6.0 was EOL with the release of 7.2 and compatible with ruby 3.3
- ruby: '3.3'
gemfile: gemfiles/mysql2/6-0.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/trilogy/6-0.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/postgresql/6-0.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/sqlite3/6-0.gemfile
ubuntu: '22.04'
# Rails 6.1 was EOL with the release of 7.2 and compatible with ruby 3.3
- ruby: '3.3'
gemfile: gemfiles/mysql2/6-1.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/trilogy/6-1.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/postgresql/6-1.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/sqlite3/6-1.gemfile
ubuntu: '22.04'
# Rails 7.0 was EOL with the release of 7.2 and compatible with ruby 3.3
- ruby: '3.3'
gemfile: gemfiles/mysql2/7-0.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/trilogy/7-0.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/postgresql/7-0.gemfile
ubuntu: '22.04'
- ruby: '3.3'
gemfile: gemfiles/sqlite3/7-0.gemfile
ubuntu: '22.04'
#
# The parallel dimension
#
# Rubinius (Isn't supported on Github Actions)
# - rvm: rbx-2
# gemfile: gemfiles/mysql2/6-0.gemfile
# - rvm: rbx-2
# gemfile: gemfiles/postgresql/6-0.gemfile
# - rvm: rbx-2
# gemfile: gemfiles/sqlite3/6-0.gemfile
exclude:
# jruby doesn't support trilogy
- ruby: 'jruby-9.4'
gemfile: gemfiles/trilogy/7-1.gemfile
- ruby: 'jruby-9.4'
gemfile: gemfiles/trilogy/7-2.gemfile
services:
postgres:
# AR before 4.2.6 doesn't work with 12
image: postgres:11-alpine
# Provide the password for postgres
env:
POSTGRES_DB: delayed_job_test
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: delayed_job_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Reinstall libpg
if: ${{ matrix.ruby < '2.4' && contains(matrix.gemfile, 'postgresql') }}
# version located via https://pkgs.org/search/?q=libpq5 and the Ubuntu 20.04 LTS package list
run: sudo apt-get update && sudo apt-get install -y --allow-downgrades libpq5=12.19-0ubuntu0.20.04.1 && sudo apt-get install -y --allow-downgrades libpq-dev
- uses: ruby/setup-ruby@v1
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 2
- name: Run tests
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
run: bundle exec rspec
- name: Coveralls Parallel
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.ruby }}-${{ matrix.gemfile }}
parallel: true
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true