Skip to content

Commit

Permalink
deps: Add MySQL to CI workflow (cerebris#1398)
Browse files Browse the repository at this point in the history
- also add dependabot workflow
- also standardize rails/ruby version quoting/ordering
  • Loading branch information
bf4 authored and lgebhardt committed Sep 19, 2023
1 parent a2e8ad5 commit be970f4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 32 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
74 changes: 43 additions & 31 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@ name: CI

on:
push:
branches: [ 'master', 'release-0-8', 'release-0-9', 'release-0-10' ]
branches: [ 'master', 'release-0-8', 'release-0-9', 'release-0-10', 'v0-11-dev' ]
pull_request:
branches: ['**']

jobs:
tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres
env:
Expand All @@ -26,43 +38,44 @@ jobs:
fail-fast: false
matrix:
ruby:
- 2.6
- 2.7
- '3.2'
- '3.1'
- '3.0'
- 3.1
- 3.2
- '2.7'
- '2.6'
rails:
- 7.0.4
- 6.1.7
- 6.0.6
- 5.2.8.1
- 5.1.7
- '7.0'
- '6.1'
- '6.0'
- '5.2'
- '5.1'
database_url:
- postgresql://postgres:password@localhost:5432/test
- sqlite3:test_db
- postgresql://postgres:password@localhost:5432/test
- mysql2://root:root@127.0.0.1:3306/test
exclude:
- ruby: 3.2
rails: 6.0.6
- ruby: 3.2
rails: 5.2.8.1
- ruby: 3.2
rails: 5.1.7
- ruby: 3.1
rails: 6.0.6
- ruby: 3.1
rails: 5.2.8.1
- ruby: 3.1
rails: 5.1.7
- ruby: '3.2'
rails: '6.0'
- ruby: '3.2'
rails: '5.2'
- ruby: '3.2'
rails: '5.1'
- ruby: '3.1'
rails: '6.0'
- ruby: '3.1'
rails: '5.2'
- ruby: '3.1'
rails: '5.1'
- ruby: '3.0'
rails: 6.0.6
rails: '6.0'
- ruby: '3.0'
rails: 5.2.8.1
rails: '5.2'
- ruby: '3.0'
rails: 5.1.7
- ruby: 2.6
rails: 7.0.4
rails: '5.1'
- ruby: '2.6'
rails: '7.0'
- database_url: postgresql://postgres:password@localhost:5432/test
rails: 5.1.7
rails: '5.1'
env:
RAILS_VERSION: ${{ matrix.rails }}
DATABASE_URL: ${{ matrix.database_url }}
Expand All @@ -73,7 +86,6 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
bundler-cache: true
- name: Run tests
run: bundle exec rake test
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ version = ENV['RAILS_VERSION'] || 'default'

platforms :ruby do
gem 'pg'
gem 'mysql2'

if version.start_with?('4.2', '5.0')
gem 'sqlite3', '~> 1.3.13'
Expand All @@ -26,4 +27,4 @@ when 'default'
gem 'railties', '>= 6.0'
else
gem 'railties', "~> #{version}"
end
end

0 comments on commit be970f4

Please sign in to comment.