-
Notifications
You must be signed in to change notification settings - Fork 688
170 lines (156 loc) · 4.41 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
name: CI
on:
- pull_request
- push
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
appraisal:
- rails52
- rails60
- rails61
- rails70
- rails71
- rails72
- rails80
- rails_main
db: [POSTGRES, MYSQL, SQLITE]
exclude:
# MySQL has issues on Ruby 2.3
# https://github.com/ruby/setup-ruby/issues/150
- ruby: "2.3"
db: MYSQL
# PostgreSQL is segfaulting on 2.3
# Doesn't seem worth solving.
- ruby: "2.3"
db: POSTGRES
# Rails 5.2 supports Ruby 2.2-2.5
- appraisal: rails52
ruby: "2.6"
- appraisal: rails52
ruby: "2.7"
- appraisal: rails52
ruby: "3.0"
- appraisal: rails52
ruby: "3.1"
- appraisal: rails52
ruby: "3.2"
- appraisal: rails52
ruby: "3.3"
# Rails 6.0 supports Ruby 2.5-2.7
- appraisal: rails60
ruby: "2.3"
- appraisal: rails60
ruby: "2.4"
- appraisal: rails60
ruby: "3.0"
- appraisal: rails60
ruby: "3.1"
- appraisal: rails60
ruby: "3.2"
- appraisal: rails60
ruby: "3.3"
# Rails 6.1 supports Ruby 2.5+
- appraisal: rails61
ruby: "2.3"
- appraisal: rails61
ruby: "2.4"
# Rails 7 supports Ruby 2.7+
- appraisal: rails70
ruby: "2.3"
- appraisal: rails70
ruby: "2.4"
- appraisal: rails70
ruby: "2.5"
- appraisal: rails70
ruby: "2.6"
# Rails 7.1 supports Ruby 2.7+
- appraisal: rails71
ruby: "2.3"
- appraisal: rails71
ruby: "2.4"
- appraisal: rails71
ruby: "2.5"
- appraisal: rails71
ruby: "2.6"
# Rails 7.2 supports Ruby 3.1+
- appraisal: rails72
ruby: "2.3"
- appraisal: rails72
ruby: "2.4"
- appraisal: rails72
ruby: "2.5"
- appraisal: rails72
ruby: "2.6"
- appraisal: rails72
ruby: "2.7"
- appraisal: rails72
ruby: "3.0"
# Rails 8.0 supports Ruby 3.2+
- appraisal: rails80
ruby: "2.3"
- appraisal: rails80
ruby: "2.4"
- appraisal: rails80
ruby: "2.5"
- appraisal: rails80
ruby: "2.6"
- appraisal: rails80
ruby: "2.7"
- appraisal: rails80
ruby: "3.0"
- appraisal: rails80
ruby: "3.1"
# Rails main supports Ruby 3.2+
- appraisal: rails_main
ruby: "2.3"
- appraisal: rails_main
ruby: "2.4"
- appraisal: rails_main
ruby: "2.5"
- appraisal: rails_main
ruby: "2.6"
- appraisal: rails_main
ruby: "2.7"
- appraisal: rails_main
ruby: "3.0"
- appraisal: rails_main
ruby: "3.1"
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: audited_test
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DB_DATABASE: audited_test
DB_USER: root
DB_PASSWORD: "root"
DB_HOST: localhost
steps:
- name: Setup MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE audited_test;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
- uses: actions/checkout@v4
- name: Copy Gemfile
run: sed 's/\.\././' gemfiles/${{ matrix.appraisal }}.gemfile > Gemfile
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
env:
DB: ${{ matrix.db }}
run: bundle exec rake