Skip to content

Commit bbad5fd

Browse files
committed
Add AR 6.0, Ruby 3.0 support, drop AR < 5.2 and Ruby < 2.5
1 parent 79e789b commit bbad5fd

25 files changed

Lines changed: 199 additions & 118 deletions

.github/workflows/prs.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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+
db:
29+
- sqlite3
30+
- skip
31+
dbversion:
32+
- skip
33+
exclude:
34+
- ruby: '3.0'
35+
activerecord: '5.2'
36+
- db: skip
37+
dbversion: skip
38+
include:
39+
- ruby: '2.5'
40+
activerecord: '5.2'
41+
db: postgresql
42+
dbversion: '9.6'
43+
- ruby: '2.5'
44+
activerecord: '6.0'
45+
db: postgresql
46+
dbversion: '9.6'
47+
- ruby: '2.7'
48+
activerecord: '5.2'
49+
db: postgresql
50+
dbversion: '9.6'
51+
- ruby: '2.7'
52+
activerecord: '6.0'
53+
db: postgresql
54+
dbversion: '9.6'
55+
- ruby: '3.0'
56+
activerecord: '6.0'
57+
db: postgresql
58+
dbversion: '9.6'
59+
env:
60+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
61+
POSTGRESQL_DB_HOST: 127.0.0.1
62+
POSTGRESQL_DB_USER: schema_plus_test
63+
POSTGRESQL_DB_PASS: database
64+
steps:
65+
- uses: actions/checkout@v2
66+
- name: Set up Ruby
67+
uses: ruby/setup-ruby@v1
68+
with:
69+
ruby-version: "${{ matrix.ruby }}"
70+
bundler-cache: true
71+
- name: Run bundle update
72+
run: bundle update
73+
- name: Start Postgresql
74+
if: matrix.db == 'postgresql'
75+
run: |
76+
docker run --rm --detach \
77+
-e POSTGRES_USER=$POSTGRESQL_DB_USER \
78+
-e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
79+
-p 5432:5432 \
80+
--health-cmd "pg_isready -q" \
81+
--health-interval 5s \
82+
--health-timeout 5s \
83+
--health-retries 5 \
84+
--name database postgres:${{ matrix.dbversion }}
85+
- name: Wait for database to start
86+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
87+
run: |
88+
COUNT=0
89+
ATTEMPTS=20
90+
until [[ $COUNT -eq $ATTEMPTS ]]; do
91+
[ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
92+
echo $(( COUNT++ )) > /dev/null
93+
sleep 2
94+
done
95+
- name: Create testing database
96+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
97+
run: bundle exec rake create_ci_database
98+
- name: Run tests
99+
run: bundle exec rake spec
100+
- name: Shutdown database
101+
if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
102+
run: docker stop database
103+
- name: Coveralls Parallel
104+
if: "${{ !env.ACT }}"
105+
uses: coverallsapp/github-action@master
106+
with:
107+
github-token: "${{ secrets.GITHUB_TOKEN }}"
108+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
109+
parallel: true
110+
finish:
111+
needs: test
112+
runs-on: ubuntu-latest
113+
steps:
114+
- name: Coveralls Finished
115+
if: "${{ !env.ACT }}"
116+
uses: coverallsapp/github-action@master
117+
with:
118+
github-token: "${{ secrets.GITHUB_TOKEN }}"
119+
parallel-finished: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/tmp
33
/pkg
44
/Gemfile.local
5+
/.idea
56

67
.byebug_history
78
*.lock

.simplecov

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

.travis.yml

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

README.md

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

65
# SchemaPlus::DefaultExpr
76

@@ -30,10 +29,11 @@ SchemaPlus::DefaultExpr is tested on:
3029

3130
<!-- SCHEMA_DEV: MATRIX - begin -->
3231
<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
33-
* ruby **2.3.1** with activerecord **4.2**, using **sqlite3** and **postgresql**
34-
* ruby **2.3.1** with activerecord **5.0**, using **sqlite3** and **postgresql**
35-
* ruby **2.3.1** with activerecord **5.1**, using **sqlite3** and **postgresql**
36-
* ruby **2.3.1** with activerecord **5.2**, using **sqlite3** and **postgresql**
32+
* ruby **2.5** with activerecord **5.2**, using **sqlite3** and **postgresql:9.6**
33+
* ruby **2.5** with activerecord **6.0**, using **sqlite3** and **postgresql:9.6**
34+
* ruby **2.7** with activerecord **5.2**, using **sqlite3** and **postgresql:9.6**
35+
* ruby **2.7** with activerecord **6.0**, using **sqlite3** and **postgresql:9.6**
36+
* ruby **3.0** with activerecord **6.0**, using **sqlite3** and **postgresql:9.6**
3737

3838
<!-- SCHEMA_DEV: MATRIX - end -->
3939

@@ -97,7 +97,7 @@ Some things to know about to help you develop and test:
9797
* **schema_dev**: SchemaPlus::DefaultExpr uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
9898
facilitate running rspec tests on the matrix of ruby, activerecord, and database
9999
versions that the gem supports, both locally and on
100-
[travis-ci](http://travis-ci.org/SchemaPlus/schema_plus_default_expr)
100+
[github actions](https://github.com/SchemaPlus/schema_plus_default_expr/actions)
101101

102102
To to run rspec locally on the full matrix, do:
103103

@@ -109,7 +109,6 @@ Some things to know about to help you develop and test:
109109
The matrix of configurations is specified in `schema_dev.yml` in
110110
the project root.
111111

112-
113112
<!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->
114113

115114
<!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_PLUS_CORE - begin -->

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.postgresql

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

gemfiles/activerecord-4.2/Gemfile.sqlite3

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

gemfiles/activerecord-5.0/Gemfile.base

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

0 commit comments

Comments
 (0)