Skip to content

Commit 43f65bb

Browse files
felipemaierurkle
authored andcommitted
update schema_dev, add AR 6, drop ruby < 2.5, drop AR < 5.2
1 parent 8978c4a commit 43f65bb

14 files changed

Lines changed: 239 additions & 59 deletions

File tree

.github/workflows/prs.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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+
- skip
30+
dbversion:
31+
- skip
32+
exclude:
33+
- ruby: '3.0'
34+
activerecord: '5.2'
35+
- db: skip
36+
dbversion: skip
37+
include:
38+
- ruby: '2.5'
39+
activerecord: '5.2'
40+
db: postgresql
41+
dbversion: '9.6'
42+
- ruby: '2.5'
43+
activerecord: '5.2'
44+
db: postgresql
45+
dbversion: '10'
46+
- ruby: '2.5'
47+
activerecord: '5.2'
48+
db: postgresql
49+
dbversion: '11'
50+
- ruby: '2.5'
51+
activerecord: '5.2'
52+
db: postgresql
53+
dbversion: '12'
54+
- ruby: '2.5'
55+
activerecord: '6.0'
56+
db: postgresql
57+
dbversion: '9.6'
58+
- ruby: '2.5'
59+
activerecord: '6.0'
60+
db: postgresql
61+
dbversion: '10'
62+
- ruby: '2.5'
63+
activerecord: '6.0'
64+
db: postgresql
65+
dbversion: '11'
66+
- ruby: '2.5'
67+
activerecord: '6.0'
68+
db: postgresql
69+
dbversion: '12'
70+
- ruby: '2.7'
71+
activerecord: '5.2'
72+
db: postgresql
73+
dbversion: '9.6'
74+
- ruby: '2.7'
75+
activerecord: '5.2'
76+
db: postgresql
77+
dbversion: '10'
78+
- ruby: '2.7'
79+
activerecord: '5.2'
80+
db: postgresql
81+
dbversion: '11'
82+
- ruby: '2.7'
83+
activerecord: '5.2'
84+
db: postgresql
85+
dbversion: '12'
86+
- ruby: '2.7'
87+
activerecord: '6.0'
88+
db: postgresql
89+
dbversion: '9.6'
90+
- ruby: '2.7'
91+
activerecord: '6.0'
92+
db: postgresql
93+
dbversion: '10'
94+
- ruby: '2.7'
95+
activerecord: '6.0'
96+
db: postgresql
97+
dbversion: '11'
98+
- ruby: '2.7'
99+
activerecord: '6.0'
100+
db: postgresql
101+
dbversion: '12'
102+
- ruby: '3.0'
103+
activerecord: '6.0'
104+
db: postgresql
105+
dbversion: '9.6'
106+
- ruby: '3.0'
107+
activerecord: '6.0'
108+
db: postgresql
109+
dbversion: '10'
110+
- ruby: '3.0'
111+
activerecord: '6.0'
112+
db: postgresql
113+
dbversion: '11'
114+
- ruby: '3.0'
115+
activerecord: '6.0'
116+
db: postgresql
117+
dbversion: '12'
118+
env:
119+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
120+
POSTGRESQL_DB_HOST: 127.0.0.1
121+
POSTGRESQL_DB_USER: schema_plus_test
122+
POSTGRESQL_DB_PASS: database
123+
steps:
124+
- uses: actions/checkout@v2
125+
- name: Set up Ruby
126+
uses: ruby/setup-ruby@v1
127+
with:
128+
ruby-version: "${{ matrix.ruby }}"
129+
bundler-cache: true
130+
- name: Run bundle update
131+
run: bundle update
132+
- name: Start Postgresql
133+
if: matrix.db == 'postgresql'
134+
run: |
135+
docker run --rm --detach \
136+
-e POSTGRES_USER=$POSTGRESQL_DB_USER \
137+
-e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
138+
-p 5432:5432 \
139+
--health-cmd "pg_isready -q" \
140+
--health-interval 5s \
141+
--health-timeout 5s \
142+
--health-retries 5 \
143+
--name database postgres:${{ matrix.dbversion }}
144+
- name: Wait for database to start
145+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
146+
run: |
147+
COUNT=0
148+
ATTEMPTS=20
149+
until [[ $COUNT -eq $ATTEMPTS ]]; do
150+
[ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
151+
echo $(( COUNT++ )) > /dev/null
152+
sleep 2
153+
done
154+
- name: Create testing database
155+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
156+
run: bundle exec rake create_ci_database
157+
- name: Run tests
158+
run: bundle exec rake spec
159+
- name: Shutdown database
160+
if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
161+
run: docker stop database
162+
- name: Coveralls Parallel
163+
if: "${{ !env.ACT }}"
164+
uses: coverallsapp/github-action@master
165+
with:
166+
github-token: "${{ secrets.GITHUB_TOKEN }}"
167+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
168+
parallel: true
169+
finish:
170+
needs: test
171+
runs-on: ubuntu-latest
172+
steps:
173+
- name: Coveralls Finished
174+
if: "${{ !env.ACT }}"
175+
uses: coverallsapp/github-action@master
176+
with:
177+
github-token: "${{ secrets.GITHUB_TOKEN }}"
178+
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
*.lock
78
*.log

.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 & 38 deletions
This file was deleted.

README.md

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

65
# SchemaPlus::Functions
76

@@ -85,7 +84,11 @@ SchemaPlus::Functions is tested on:
8584

8685
<!-- SCHEMA_DEV: MATRIX - begin -->
8786
<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
88-
* ruby **2.3.1** with activerecord **5.2**, using **postgresql**
87+
* ruby **2.5** with activerecord **5.2**, using **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
88+
* ruby **2.5** with activerecord **6.0**, using **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
89+
* ruby **2.7** with activerecord **5.2**, using **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
90+
* ruby **2.7** with activerecord **6.0**, using **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
91+
* ruby **3.0** with activerecord **6.0**, using **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
8992

9093
<!-- SCHEMA_DEV: MATRIX - end -->
9194

@@ -107,7 +110,7 @@ Some things to know about to help you develop and test:
107110
* **schema_dev**: SchemaPlus::Functions uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
108111
facilitate running rspec tests on the matrix of ruby, activerecord, and database
109112
versions that the gem supports, both locally and on
110-
[travis-ci](http://travis-ci.org/SchemaPlus/schema_plus_functions)
113+
[github actions](https://github.com/SchemaPlus/schema_plus_functions/actions)
111114

112115
To to run rspec locally on the full matrix, do:
113116

@@ -119,7 +122,6 @@ Some things to know about to help you develop and test:
119122
The matrix of configurations is specified in `schema_dev.yml` in
120123
the project root.
121124

122-
123125
<!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->
124126

125127
<!-- 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
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
eval File.read File.expand_path('../../Gemfile.base', __FILE__)
1+
base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2+
eval File.read(base_gemfile)
23

34
gem "activerecord", ">= 5.2.0.beta0", "< 5.3"

gemfiles/activerecord-5.2/Gemfile.postgresql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
require "pathname"
2-
eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1+
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2+
eval File.read(base_gemfile), binding, base_gemfile
33

44
platform :ruby do
55
gem "pg"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2+
eval File.read(base_gemfile)
3+
4+
gem "activerecord", ">= 6.0", "< 6.1"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2+
eval File.read(base_gemfile), binding, base_gemfile
3+
4+
platform :ruby do
5+
gem "pg"
6+
end
7+
8+
platform :jruby do
9+
gem 'activerecord-jdbcpostgresql-adapter'
10+
end

0 commit comments

Comments
 (0)