Skip to content

Commit db25cca

Browse files
committed
bump schema_dev and tests rails 6.0 and 6.1 and drop rails < 5.2 and test on ruby 2.5, 2.7, and 3.0
1 parent 9df303a commit db25cca

32 files changed

+266
-148
lines changed

.github/workflows/prs.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# This file was auto-generated by the schema_dev tool, based on the data in
2+
# ./schema_dev.yml
3+
# Please do not edit this file; any changes will be overwritten next time
4+
# schema_dev gets run.
5+
---
6+
name: CI PR Builds
7+
'on':
8+
push:
9+
branches:
10+
- master
11+
pull_request:
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
ruby:
22+
- '2.5'
23+
- '2.7'
24+
- '3.0'
25+
activerecord:
26+
- '5.2'
27+
- '6.0'
28+
- '6.1'
29+
db:
30+
- mysql2
31+
- sqlite3
32+
- skip
33+
dbversion:
34+
- skip
35+
exclude:
36+
- ruby: '3.0'
37+
activerecord: '5.2'
38+
- db: skip
39+
dbversion: skip
40+
include:
41+
- ruby: '2.5'
42+
activerecord: '5.2'
43+
db: postgresql
44+
dbversion: '9.6'
45+
- ruby: '2.5'
46+
activerecord: '6.0'
47+
db: postgresql
48+
dbversion: '9.6'
49+
- ruby: '2.5'
50+
activerecord: '6.1'
51+
db: postgresql
52+
dbversion: '9.6'
53+
- ruby: '2.7'
54+
activerecord: '5.2'
55+
db: postgresql
56+
dbversion: '9.6'
57+
- ruby: '2.7'
58+
activerecord: '6.0'
59+
db: postgresql
60+
dbversion: '9.6'
61+
- ruby: '2.7'
62+
activerecord: '6.1'
63+
db: postgresql
64+
dbversion: '9.6'
65+
- ruby: '3.0'
66+
activerecord: '6.0'
67+
db: postgresql
68+
dbversion: '9.6'
69+
- ruby: '3.0'
70+
activerecord: '6.1'
71+
db: postgresql
72+
dbversion: '9.6'
73+
env:
74+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
75+
MYSQL_DB_HOST: 127.0.0.1
76+
MYSQL_DB_USER: root
77+
MYSQL_DB_PASS: database
78+
POSTGRESQL_DB_HOST: 127.0.0.1
79+
POSTGRESQL_DB_USER: schema_plus_test
80+
POSTGRESQL_DB_PASS: database
81+
steps:
82+
- uses: actions/checkout@v2
83+
- name: Set up Ruby
84+
uses: ruby/setup-ruby@v1
85+
with:
86+
ruby-version: "${{ matrix.ruby }}"
87+
bundler-cache: true
88+
- name: Run bundle update
89+
run: bundle update
90+
- name: Start Mysql
91+
if: matrix.db == 'mysql2'
92+
run: |
93+
docker run --rm --detach \
94+
-e MYSQL_ROOT_PASSWORD=$MYSQL_DB_PASS \
95+
-p 3306:3306 \
96+
--health-cmd "mysqladmin ping --host=127.0.0.1 --password=$MYSQL_DB_PASS --silent" \
97+
--health-interval 5s \
98+
--health-timeout 5s \
99+
--health-retries 5 \
100+
--name database mysql:5.6
101+
- name: Start Postgresql
102+
if: matrix.db == 'postgresql'
103+
run: |
104+
docker run --rm --detach \
105+
-e POSTGRES_USER=$POSTGRESQL_DB_USER \
106+
-e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
107+
-p 5432:5432 \
108+
--health-cmd "pg_isready -q" \
109+
--health-interval 5s \
110+
--health-timeout 5s \
111+
--health-retries 5 \
112+
--name database postgres:${{ matrix.dbversion }}
113+
- name: Wait for database to start
114+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
115+
run: |
116+
COUNT=0
117+
ATTEMPTS=20
118+
until [[ $COUNT -eq $ATTEMPTS ]]; do
119+
[ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
120+
echo $(( COUNT++ )) > /dev/null
121+
sleep 2
122+
done
123+
- name: Create testing database
124+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
125+
run: bundle exec rake create_ci_database
126+
- name: Run tests
127+
run: bundle exec rake spec
128+
- name: Shutdown database
129+
if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
130+
run: docker stop database
131+
- name: Coveralls Parallel
132+
if: "${{ !env.ACT }}"
133+
uses: coverallsapp/github-action@master
134+
with:
135+
github-token: "${{ secrets.GITHUB_TOKEN }}"
136+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
137+
parallel: true
138+
finish:
139+
needs: test
140+
runs-on: ubuntu-latest
141+
steps:
142+
- name: Coveralls Finished
143+
if: "${{ !env.ACT }}"
144+
uses: coverallsapp/github-action@master
145+
with:
146+
github-token: "${{ secrets.GITHUB_TOKEN }}"
147+
parallel-finished: true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/coverage
22
/tmp
33
/pkg
4-
Gemfile.local
4+
/Gemfile.local
55

66
*.lock
77
*.log

.simplecov

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
SimpleCov.configure do
2+
enable_coverage :branch
3+
add_filter '/spec/'
4+
5+
add_group 'Binaries', '/bin/'
6+
add_group 'Libraries', '/lib/'
7+
8+
if ENV['CI']
9+
require 'simplecov-lcov'
10+
11+
SimpleCov::Formatter::LcovFormatter.config do |c|
12+
c.report_with_single_file = true
13+
c.single_report_path = 'coverage/lcov.info'
14+
end
15+
16+
formatter SimpleCov::Formatter::LcovFormatter
17+
end
18+
end

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ source "http://rubygems.org"
22

33
gemspec
44

5-
File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
5+
gemfile_local = File.expand_path '../Gemfile.local', __FILE__
6+
eval File.read(gemfile_local), binding, gemfile_local if File.exist? gemfile_local

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[![Gem Version](https://badge.fury.io/rb/schema_monkey.svg)](http://badge.fury.io/rb/schema_monkey)
2-
[![Build Status](https://secure.travis-ci.org/SchemaPlus/schema_monkey.svg)](http://travis-ci.org/SchemaPlus/schema_monkey)
2+
[![Build Status](https://github.com/SchemaPlus/schema_monkey/actions/workflows/prs.yml/badge.svg)](https://github.com/SchemaPlus/schema_monkey/actions)
33
[![Coverage Status](https://img.shields.io/coveralls/SchemaPlus/schema_monkey.svg)](https://coveralls.io/r/SchemaPlus/schema_monkey)
4-
[![Dependency Status](https://gemnasium.com/lomba/schema_monkey.svg)](https://gemnasium.com/SchemaPlus/schema_monkey)
54

65
# SchemaMonkey
76

@@ -227,10 +226,14 @@ SchemaMonkey is tested on:
227226

228227
<!-- SCHEMA_DEV: MATRIX - begin -->
229228
<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
230-
* ruby **2.3.1** with activerecord **4.2**, using **mysql2**, **sqlite3** or **postgresql**
231-
* ruby **2.3.1** with activerecord **5.0**, using **mysql2**, **sqlite3** or **postgresql**
232-
* ruby **2.3.1** with activerecord **5.1**, using **mysql2**, **sqlite3** or **postgresql**
233-
* ruby **2.3.1** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql**
229+
* ruby **2.5** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql:9.6**
230+
* ruby **2.5** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
231+
* ruby **2.5** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
232+
* ruby **2.7** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql:9.6**
233+
* ruby **2.7** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
234+
* ruby **2.7** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
235+
* ruby **3.0** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
236+
* ruby **3.0** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
234237

235238
<!-- SCHEMA_DEV: MATRIX - end -->
236239

@@ -256,7 +259,7 @@ Some things to know about to help you develop and test:
256259
* **schema_dev**: SchemaMonkey uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
257260
facilitate running rspec tests on the matrix of ruby, activerecord, and database
258261
versions that the gem supports, both locally and on
259-
[travis-ci](http://travis-ci.org/SchemaPlus/schema_monkey)
262+
[github actions](https://github.com/SchemaPlus/schema_monkey/actions)
260263

261264
To to run rspec locally on the full matrix, do:
262265

@@ -268,5 +271,4 @@ Some things to know about to help you develop and test:
268271
The matrix of configurations is specified in `schema_dev.yml` in
269272
the project root.
270273

271-
272274
<!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->

gemfiles/Gemfile.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
2-
gemspec :path => File.expand_path('..', __FILE__)
2+
gemspec path: File.expand_path('..', __FILE__)
33

44
File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local

gemfiles/activerecord-4.2/Gemfile.base

Lines changed: 0 additions & 3 deletions
This file was deleted.

gemfiles/activerecord-4.2/Gemfile.mysql2

Lines changed: 0 additions & 10 deletions
This file was deleted.

gemfiles/activerecord-4.2/Gemfile.postgresql

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)