forked from collectiveidea/audited
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (132 loc) · 3.62 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
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]
appraisal:
- rails50
- rails51
- rails52
- rails60
- rails61
- rails70
- rails71
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.0 supports Ruby 2.2-2.4
- appraisal: rails50
ruby: 2.5
- appraisal: rails50
ruby: 2.6
- appraisal: rails50
ruby: 2.7
- appraisal: rails50
ruby: 3.0
- appraisal: rails50
ruby: 3.1
- appraisal: rails50
ruby: 3.2
# Rails 5.1 supports Ruby 2.2-2.5
- appraisal: rails51
ruby: 2.6
- appraisal: rails51
ruby: 2.7
- appraisal: rails51
ruby: 3.0
- appraisal: rails51
ruby: 3.1
- appraisal: rails51
ruby: 3.2
# 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
# 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
# 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
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@v3
- 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