Skip to content

Commit be970f4

Browse files
bf4lgebhardt
authored andcommitted
deps: Add MySQL to CI workflow (#1398)
- also add dependabot workflow - also standardize rails/ruby version quoting/ordering
1 parent a2e8ad5 commit be970f4

File tree

3 files changed

+55
-32
lines changed

3 files changed

+55
-32
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
# Check for updates to GitHub Actions every weekday
10+
interval: "daily"

.github/workflows/ruby.yml

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@ name: CI
22

33
on:
44
push:
5-
branches: [ 'master', 'release-0-8', 'release-0-9', 'release-0-10' ]
5+
branches: [ 'master', 'release-0-8', 'release-0-9', 'release-0-10', 'v0-11-dev' ]
66
pull_request:
77
branches: ['**']
88

99
jobs:
1010
tests:
1111
runs-on: ubuntu-latest
1212
services:
13+
mysql:
14+
image: mysql
15+
env:
16+
MYSQL_ROOT_PASSWORD: root
17+
MYSQL_DATABASE: test
18+
ports:
19+
- 3306:3306
20+
options: >-
21+
--health-cmd "mysqladmin ping"
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
1325
postgres:
1426
image: postgres
1527
env:
@@ -26,43 +38,44 @@ jobs:
2638
fail-fast: false
2739
matrix:
2840
ruby:
29-
- 2.6
30-
- 2.7
41+
- '3.2'
42+
- '3.1'
3143
- '3.0'
32-
- 3.1
33-
- 3.2
44+
- '2.7'
45+
- '2.6'
3446
rails:
35-
- 7.0.4
36-
- 6.1.7
37-
- 6.0.6
38-
- 5.2.8.1
39-
- 5.1.7
47+
- '7.0'
48+
- '6.1'
49+
- '6.0'
50+
- '5.2'
51+
- '5.1'
4052
database_url:
41-
- postgresql://postgres:password@localhost:5432/test
4253
- sqlite3:test_db
54+
- postgresql://postgres:password@localhost:5432/test
55+
- mysql2://root:root@127.0.0.1:3306/test
4356
exclude:
44-
- ruby: 3.2
45-
rails: 6.0.6
46-
- ruby: 3.2
47-
rails: 5.2.8.1
48-
- ruby: 3.2
49-
rails: 5.1.7
50-
- ruby: 3.1
51-
rails: 6.0.6
52-
- ruby: 3.1
53-
rails: 5.2.8.1
54-
- ruby: 3.1
55-
rails: 5.1.7
57+
- ruby: '3.2'
58+
rails: '6.0'
59+
- ruby: '3.2'
60+
rails: '5.2'
61+
- ruby: '3.2'
62+
rails: '5.1'
63+
- ruby: '3.1'
64+
rails: '6.0'
65+
- ruby: '3.1'
66+
rails: '5.2'
67+
- ruby: '3.1'
68+
rails: '5.1'
5669
- ruby: '3.0'
57-
rails: 6.0.6
70+
rails: '6.0'
5871
- ruby: '3.0'
59-
rails: 5.2.8.1
72+
rails: '5.2'
6073
- ruby: '3.0'
61-
rails: 5.1.7
62-
- ruby: 2.6
63-
rails: 7.0.4
74+
rails: '5.1'
75+
- ruby: '2.6'
76+
rails: '7.0'
6477
- database_url: postgresql://postgres:password@localhost:5432/test
65-
rails: 5.1.7
78+
rails: '5.1'
6679
env:
6780
RAILS_VERSION: ${{ matrix.rails }}
6881
DATABASE_URL: ${{ matrix.database_url }}
@@ -73,7 +86,6 @@ jobs:
7386
uses: ruby/setup-ruby@v1
7487
with:
7588
ruby-version: ${{ matrix.ruby }}
76-
- name: Install dependencies
77-
run: bundle install --jobs 4 --retry 3
89+
bundler-cache: true
7890
- name: Run tests
7991
run: bundle exec rake test

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ version = ENV['RAILS_VERSION'] || 'default'
1010

1111
platforms :ruby do
1212
gem 'pg'
13+
gem 'mysql2'
1314

1415
if version.start_with?('4.2', '5.0')
1516
gem 'sqlite3', '~> 1.3.13'
@@ -26,4 +27,4 @@ when 'default'
2627
gem 'railties', '>= 6.0'
2728
else
2829
gem 'railties', "~> #{version}"
29-
end
30+
end

0 commit comments

Comments
 (0)