schema_dev 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/prs.yml +16 -4
- data/.gitignore +1 -0
- data/Gemfile +2 -1
- data/README.md +2 -0
- data/gemfiles/Gemfile.activesupport-5.2 +4 -0
- data/gemfiles/Gemfile.activesupport-6.0 +4 -0
- data/gemfiles/Gemfile.activesupport-6.1 +4 -0
- data/gemfiles/Gemfile.activesupport-7.0 +4 -0
- data/gemfiles/Gemfile.base +4 -0
- data/lib/schema_dev/config.rb +19 -5
- data/lib/schema_dev/github_actions.rb +1 -1
- data/lib/schema_dev/rspec/db.rb +20 -2
- data/lib/schema_dev/version.rb +1 -1
- data/schema_dev.gemspec +1 -1
- data/spec/schema_dev/config_spec.rb +13 -0
- data/spec/schema_dev/github_actions_spec.rb +80 -8
- data/spec/spec_helper.rb +1 -1
- data/templates/gem/spec/spec_helper.rb.erb +1 -1
- data/templates/gemfiles/activerecord-7.0/Gemfile.base.erb +4 -0
- data/templates/gemfiles/activerecord-7.0/Gemfile.mysql2.erb +10 -0
- data/templates/gemfiles/activerecord-7.0/Gemfile.postgresql.erb +10 -0
- data/templates/gemfiles/activerecord-7.0/Gemfile.sqlite3.erb +10 -0
- metadata +13 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50cc2bddf7346d81775cd66fdec8d2dfff9755110a28808c1b344c884e9804d0
|
4
|
+
data.tar.gz: e0df8587750447828fd2fddf9ed634b878dfb4b3c2422bef056936ddd74abd2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 883156b6f5408b599766606a33cfca654b7406d5e61f02694fc5629d3481eb8f2a08c2a3be4d59bf520cf85f213368234f68d3c1a5f2594bf66bbd5869526a76
|
7
|
+
data.tar.gz: fc0712880c7aff4f22814ba109abdbddf052897b1d769aff604d8bb5d2708e1b75f89fbe00f7a4280943dbcaa2de387b213d4698a05a2e1269fc6607d4736fa7
|
data/.github/workflows/prs.yml
CHANGED
@@ -7,7 +7,7 @@ on:
|
|
7
7
|
pull_request:
|
8
8
|
|
9
9
|
concurrency:
|
10
|
-
group:
|
10
|
+
group: "ci-${{ github.ref }}"
|
11
11
|
cancel-in-progress: true
|
12
12
|
|
13
13
|
jobs:
|
@@ -16,14 +16,26 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby
|
19
|
+
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
20
|
+
activesupport: ['5.2', '6.0', '6.1', '7.0']
|
21
|
+
exclude:
|
22
|
+
- ruby: '2.5'
|
23
|
+
activesupport: '7.0'
|
24
|
+
- ruby: '2.6'
|
25
|
+
activesupport: '7.0'
|
26
|
+
- ruby: '3.0'
|
27
|
+
activesupport: '5.2'
|
28
|
+
- ruby: '3.1'
|
29
|
+
activesupport: '5.2'
|
30
|
+
env:
|
31
|
+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/Gemfile.activesupport-${{ matrix.activesupport }}"
|
20
32
|
steps:
|
21
33
|
- uses: actions/checkout@v2
|
22
34
|
|
23
35
|
- name: Set up Ruby
|
24
36
|
uses: ruby/setup-ruby@v1
|
25
37
|
with:
|
26
|
-
ruby-version: ${{ matrix.ruby
|
38
|
+
ruby-version: ${{ matrix.ruby }}
|
27
39
|
bundler-cache: true
|
28
40
|
|
29
41
|
- name: 'Run bundle update'
|
@@ -36,7 +48,7 @@ jobs:
|
|
36
48
|
uses: coverallsapp/github-action@master
|
37
49
|
with:
|
38
50
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
39
|
-
flag-name: run-${{ matrix.ruby
|
51
|
+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activesupport }}
|
40
52
|
parallel: true
|
41
53
|
finish:
|
42
54
|
needs: 'test'
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -136,6 +136,8 @@ Which defines the rake task `create_databases` and also a task for github action
|
|
136
136
|
|
137
137
|
Release notes for schema_dev versions:
|
138
138
|
|
139
|
+
* **4.2.0** - Add AR 7.0, and Ruby 3.1 support. Also add more shared rspec filters
|
140
|
+
* **4.1.1** - Fix github actions generated files for concurrency detection
|
139
141
|
* **4.1.0** - Switch to GitHub actions instead of travis CI
|
140
142
|
* **4.0.0** - Drop support for AR < 5.2 and add AR 6.0 and 6.1
|
141
143
|
* **3.13.1** - Adjust travis.yml generation to work with mysql again
|
data/lib/schema_dev/config.rb
CHANGED
@@ -17,7 +17,11 @@ module SchemaDev
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.read
|
20
|
-
new(
|
20
|
+
if ::Gem::Version.new(RUBY_VERSION) >= ::Gem::Version.new('3.1')
|
21
|
+
new(**YAML.safe_load(Pathname.new(CONFIG_FILE).read, permitted_classes: [Symbol], symbolize_names: true))
|
22
|
+
else
|
23
|
+
new(**YAML.safe_load(Pathname.new(CONFIG_FILE).read, [Symbol], symbolize_names: true))
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
def self.load
|
@@ -30,11 +34,21 @@ module SchemaDev
|
|
30
34
|
@db = Array.wrap(db)
|
31
35
|
@dbversions = (dbversions || {}).symbolize_keys
|
32
36
|
@exclude = Array.wrap(exclude).map(&:symbolize_keys).map { |tuple| Tuple.new(**tuple.transform_values(&:to_s)) }
|
33
|
-
|
34
|
-
|
37
|
+
@activerecord.each do |ar_version|
|
38
|
+
ar_check = ::Gem::Version.new(ar_version)
|
39
|
+
|
40
|
+
if ar_check < ::Gem::Version.new('6.0')
|
41
|
+
ruby3 = ::Gem::Version.new('3.0')
|
42
|
+
|
43
|
+
@ruby.select { |e| ::Gem::Version.new(e) >= ruby3 }.each do |v|
|
44
|
+
@exclude << Tuple.new(ruby: v, activerecord: ar_version)
|
45
|
+
end
|
46
|
+
elsif ar_check >= ::Gem::Version.new('7.0')
|
47
|
+
ruby27 = ::Gem::Version.new('2.7')
|
35
48
|
|
36
|
-
|
37
|
-
|
49
|
+
@ruby.select { |e| ::Gem::Version.new(e) < ruby27 }.each do |v|
|
50
|
+
@exclude << Tuple.new(ruby: v, activerecord: ar_version)
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
40
54
|
unless notify.nil?
|
data/lib/schema_dev/rspec/db.rb
CHANGED
@@ -14,12 +14,30 @@ module SchemaDev
|
|
14
14
|
connect
|
15
15
|
RSpec.configure do |config|
|
16
16
|
config.include Helpers
|
17
|
-
config.filter_run_excluding postgresql:
|
18
|
-
|
17
|
+
config.filter_run_excluding postgresql: -> (v) {
|
18
|
+
if Helpers.postgresql?
|
19
|
+
case v
|
20
|
+
when String
|
21
|
+
version = ActiveRecord::Base.connection.select_value("SHOW server_version").match(/(\d+\.\d+)/)[1]
|
22
|
+
postgresql_version = Gem::Version.new(version)
|
23
|
+
test = Gem::Requirement.new(v)
|
24
|
+
!test.satisfied_by?(postgresql_version)
|
25
|
+
else
|
26
|
+
v == :skip
|
27
|
+
end
|
28
|
+
else
|
29
|
+
v == :only
|
30
|
+
end
|
31
|
+
}
|
19
32
|
config.filter_run_excluding mysql: :only unless Helpers.mysql?
|
20
33
|
config.filter_run_excluding mysql: :skip if Helpers.mysql?
|
21
34
|
config.filter_run_excluding sqlite3: :only unless Helpers.sqlite3?
|
22
35
|
config.filter_run_excluding sqlite3: :skip if Helpers.sqlite3?
|
36
|
+
config.filter_run_excluding rails: -> (v) {
|
37
|
+
rails_version = Gem::Version.new(ActiveRecord::VERSION::STRING)
|
38
|
+
test = Gem::Requirement.new(v)
|
39
|
+
!test.satisfied_by?(rails_version)
|
40
|
+
}
|
23
41
|
end
|
24
42
|
end
|
25
43
|
|
data/lib/schema_dev/version.rb
CHANGED
data/schema_dev.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
|
|
21
21
|
|
22
22
|
gem.required_ruby_version = '>= 2.5.0'
|
23
23
|
|
24
|
-
gem.add_dependency 'activesupport', '>= 5.2', '<
|
24
|
+
gem.add_dependency 'activesupport', '>= 5.2', '< 7.1'
|
25
25
|
gem.add_dependency 'faraday', '~> 1.0'
|
26
26
|
gem.add_dependency 'simplecov'
|
27
27
|
gem.add_dependency 'simplecov-lcov', '~> 0.8.0'
|
@@ -57,4 +57,17 @@ describe SchemaDev::Config do
|
|
57
57
|
{ ruby: '2.1.5', activerecord: '4.1', db: 'postgresql' },
|
58
58
|
]
|
59
59
|
end
|
60
|
+
|
61
|
+
it 'excludes variations that are not possible' do
|
62
|
+
config = get_config(ruby: %w[2.6 2.7 3.0], activerecord: %w[5.2 6.0 7.0], db: %w[sqlite3])
|
63
|
+
expect(config.matrix).to contain_exactly(
|
64
|
+
{ ruby: '2.6', activerecord: '5.2', db: 'sqlite3' },
|
65
|
+
{ ruby: '2.6', activerecord: '6.0', db: 'sqlite3' },
|
66
|
+
{ ruby: '2.7', activerecord: '5.2', db: 'sqlite3' },
|
67
|
+
{ ruby: '2.7', activerecord: '6.0', db: 'sqlite3' },
|
68
|
+
{ ruby: '2.7', activerecord: '7.0', db: 'sqlite3' },
|
69
|
+
{ ruby: '3.0', activerecord: '6.0', db: 'sqlite3' },
|
70
|
+
{ ruby: '3.0', activerecord: '7.0', db: 'sqlite3' },
|
71
|
+
)
|
72
|
+
end
|
60
73
|
end
|
@@ -31,7 +31,7 @@ describe SchemaDev::GithubActions do
|
|
31
31
|
- master
|
32
32
|
pull_request:
|
33
33
|
concurrency:
|
34
|
-
group:
|
34
|
+
group: ci-${{ github.ref }}
|
35
35
|
cancel-in-progress: true
|
36
36
|
jobs:
|
37
37
|
test:
|
@@ -99,7 +99,7 @@ describe SchemaDev::GithubActions do
|
|
99
99
|
- master
|
100
100
|
pull_request:
|
101
101
|
concurrency:
|
102
|
-
group:
|
102
|
+
group: ci-${{ github.ref }}
|
103
103
|
cancel-in-progress: true
|
104
104
|
jobs:
|
105
105
|
test:
|
@@ -152,6 +152,78 @@ describe SchemaDev::GithubActions do
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
+
context 'when AR 7.0 is included with Ruby < 2.7' do
|
156
|
+
let(:config) do
|
157
|
+
{
|
158
|
+
ruby: [2.5, 2.7],
|
159
|
+
activerecord: [6.0, 7.0],
|
160
|
+
db: %w[sqlite3]
|
161
|
+
}
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'automatically excludes Ruby < 2.7 for AR 7.0' do
|
165
|
+
is_expected.to eq described_class::HEADER + <<~YAML
|
166
|
+
---
|
167
|
+
name: CI PR Builds
|
168
|
+
'on':
|
169
|
+
push:
|
170
|
+
branches:
|
171
|
+
- master
|
172
|
+
pull_request:
|
173
|
+
concurrency:
|
174
|
+
group: ci-${{ github.ref }}
|
175
|
+
cancel-in-progress: true
|
176
|
+
jobs:
|
177
|
+
test:
|
178
|
+
runs-on: ubuntu-latest
|
179
|
+
strategy:
|
180
|
+
fail-fast: false
|
181
|
+
matrix:
|
182
|
+
ruby:
|
183
|
+
- '2.5'
|
184
|
+
- '2.7'
|
185
|
+
activerecord:
|
186
|
+
- '6.0'
|
187
|
+
- '7.0'
|
188
|
+
db:
|
189
|
+
- sqlite3
|
190
|
+
exclude:
|
191
|
+
- ruby: '2.5'
|
192
|
+
activerecord: '7.0'
|
193
|
+
env:
|
194
|
+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
|
195
|
+
steps:
|
196
|
+
- uses: actions/checkout@v2
|
197
|
+
- name: Set up Ruby
|
198
|
+
uses: ruby/setup-ruby@v1
|
199
|
+
with:
|
200
|
+
ruby-version: "${{ matrix.ruby }}"
|
201
|
+
bundler-cache: true
|
202
|
+
- name: Run bundle update
|
203
|
+
run: bundle update
|
204
|
+
- name: Run tests
|
205
|
+
run: bundle exec rake spec
|
206
|
+
- name: Coveralls Parallel
|
207
|
+
if: "${{ !env.ACT }}"
|
208
|
+
uses: coverallsapp/github-action@master
|
209
|
+
with:
|
210
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
211
|
+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
|
212
|
+
parallel: true
|
213
|
+
finish:
|
214
|
+
needs: test
|
215
|
+
runs-on: ubuntu-latest
|
216
|
+
steps:
|
217
|
+
- name: Coveralls Finished
|
218
|
+
if: "${{ !env.ACT }}"
|
219
|
+
uses: coverallsapp/github-action@master
|
220
|
+
with:
|
221
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
222
|
+
parallel-finished: true
|
223
|
+
YAML
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
155
227
|
context 'when notify is passed' do
|
156
228
|
let(:config) do
|
157
229
|
{
|
@@ -180,7 +252,7 @@ describe SchemaDev::GithubActions do
|
|
180
252
|
- master
|
181
253
|
pull_request:
|
182
254
|
concurrency:
|
183
|
-
group:
|
255
|
+
group: ci-${{ github.ref }}
|
184
256
|
cancel-in-progress: true
|
185
257
|
jobs:
|
186
258
|
test:
|
@@ -247,7 +319,7 @@ describe SchemaDev::GithubActions do
|
|
247
319
|
- master
|
248
320
|
pull_request:
|
249
321
|
concurrency:
|
250
|
-
group:
|
322
|
+
group: ci-${{ github.ref }}
|
251
323
|
cancel-in-progress: true
|
252
324
|
jobs:
|
253
325
|
test:
|
@@ -360,7 +432,7 @@ describe SchemaDev::GithubActions do
|
|
360
432
|
- master
|
361
433
|
pull_request:
|
362
434
|
concurrency:
|
363
|
-
group:
|
435
|
+
group: ci-${{ github.ref }}
|
364
436
|
cancel-in-progress: true
|
365
437
|
jobs:
|
366
438
|
test:
|
@@ -459,7 +531,7 @@ describe SchemaDev::GithubActions do
|
|
459
531
|
- master
|
460
532
|
pull_request:
|
461
533
|
concurrency:
|
462
|
-
group:
|
534
|
+
group: ci-${{ github.ref }}
|
463
535
|
cancel-in-progress: true
|
464
536
|
jobs:
|
465
537
|
test:
|
@@ -582,7 +654,7 @@ describe SchemaDev::GithubActions do
|
|
582
654
|
- master
|
583
655
|
pull_request:
|
584
656
|
concurrency:
|
585
|
-
group:
|
657
|
+
group: ci-${{ github.ref }}
|
586
658
|
cancel-in-progress: true
|
587
659
|
jobs:
|
588
660
|
test:
|
@@ -699,7 +771,7 @@ describe SchemaDev::GithubActions do
|
|
699
771
|
- master
|
700
772
|
pull_request:
|
701
773
|
concurrency:
|
702
|
-
group:
|
774
|
+
group: ci-${{ github.ref }}
|
703
775
|
cancel-in-progress: true
|
704
776
|
jobs:
|
705
777
|
test:
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: faraday
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,6 +193,11 @@ files:
|
|
193
193
|
- README.md
|
194
194
|
- Rakefile
|
195
195
|
- bin/schema_dev
|
196
|
+
- gemfiles/Gemfile.activesupport-5.2
|
197
|
+
- gemfiles/Gemfile.activesupport-6.0
|
198
|
+
- gemfiles/Gemfile.activesupport-6.1
|
199
|
+
- gemfiles/Gemfile.activesupport-7.0
|
200
|
+
- gemfiles/Gemfile.base
|
196
201
|
- lib/schema_dev.rb
|
197
202
|
- lib/schema_dev/config.rb
|
198
203
|
- lib/schema_dev/executor.rb
|
@@ -248,6 +253,10 @@ files:
|
|
248
253
|
- templates/gemfiles/activerecord-6.1/Gemfile.mysql2.erb
|
249
254
|
- templates/gemfiles/activerecord-6.1/Gemfile.postgresql.erb
|
250
255
|
- templates/gemfiles/activerecord-6.1/Gemfile.sqlite3.erb
|
256
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.base.erb
|
257
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.mysql2.erb
|
258
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.postgresql.erb
|
259
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.sqlite3.erb
|
251
260
|
homepage: https://github.com/SchemaPlus/schema_dev
|
252
261
|
licenses:
|
253
262
|
- MIT
|