activerecord-cte 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +1 -1
- data/.github/workflows/test-with-mysql.yml +2 -2
- data/.github/workflows/test-with-postgresql.yml +2 -2
- data/.github/workflows/test-with-sqlite.yml +2 -2
- data/bin/test +27 -25
- data/lib/activerecord/cte/core_ext.rb +2 -2
- data/lib/activerecord/cte/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa6017d175139cbb92a4428130dc7ca14c10018a9a32d9c3dba0a6b68e41e348
|
4
|
+
data.tar.gz: 139a0430c0f9732e36de816475d9c3d8fc12bd326ef1349401549193112652f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '095fb61691550d6b95064d6d64e821759fd57d820f065eef9785284329bc8edceb69f8a29e244a25258851acc540bbc99446823f2309f4a1f2e6d8454cde779d'
|
7
|
+
data.tar.gz: 308d0fe1766731ff4977783249d12a0ac9f845321124b4db793ef5ed13c00585af36afa4958e7ee5fe57d7175ac5d481f1a822fe0151552a9a9856050712ad10
|
@@ -1,12 +1,12 @@
|
|
1
1
|
name: MySql
|
2
|
-
on: [
|
2
|
+
on: [pull_request]
|
3
3
|
jobs:
|
4
4
|
Test-With-Mysql:
|
5
5
|
runs-on: ubuntu-latest
|
6
6
|
strategy:
|
7
7
|
fail-fast: false
|
8
8
|
matrix:
|
9
|
-
active_record: [6.0.4, 5.2.6]
|
9
|
+
active_record: [6.1.4, 6.0.4, 5.2.6]
|
10
10
|
env:
|
11
11
|
ACTIVE_RECORD_VERSION: ${{ matrix.active_record }}
|
12
12
|
DATABASE_ADAPTER: mysql
|
@@ -1,5 +1,5 @@
|
|
1
1
|
name: PostgreSQL
|
2
|
-
on: [
|
2
|
+
on: [pull_request]
|
3
3
|
jobs:
|
4
4
|
Test-With-PostgreSQL:
|
5
5
|
runs-on: ubuntu-latest
|
@@ -7,7 +7,7 @@ jobs:
|
|
7
7
|
strategy:
|
8
8
|
fail-fast: false
|
9
9
|
matrix:
|
10
|
-
active_record: [6.0.4, 5.2.6]
|
10
|
+
active_record: [6.1.4, 6.0.4, 5.2.6]
|
11
11
|
env:
|
12
12
|
ACTIVE_RECORD_VERSION: ${{ matrix.active_record }}
|
13
13
|
DATABASE_ADAPTER: postgresql
|
@@ -1,12 +1,12 @@
|
|
1
1
|
name: SQLite
|
2
|
-
on: [
|
2
|
+
on: [pull_request]
|
3
3
|
jobs:
|
4
4
|
Test-With-SQLite:
|
5
5
|
runs-on: ubuntu-latest
|
6
6
|
strategy:
|
7
7
|
fail-fast: false
|
8
8
|
matrix:
|
9
|
-
active_record: [6.0.4, 5.2.6]
|
9
|
+
active_record: [6.1.4, 6.0.4, 5.2.6]
|
10
10
|
env:
|
11
11
|
ACTIVE_RECORD_VERSION: ${{ matrix.active_record }}
|
12
12
|
DATABASE_ADAPTER: sqlite3
|
data/bin/test
CHANGED
@@ -2,39 +2,31 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "English"
|
5
|
+
require "yaml"
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
postgresql
|
9
|
-
sqlite3
|
10
|
-
].freeze
|
7
|
+
active_record_versions = []
|
8
|
+
database_adapters = []
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
].
|
10
|
+
# Extract ActiveRecord versions and database adapters from CI workflows
|
11
|
+
Dir[".github/workflows/test-**.yml"].each do |path|
|
12
|
+
yml = YAML.load_file(path)
|
13
|
+
job = yml["jobs"].values.first
|
14
|
+
active_record_versions << job["strategy"]["matrix"]["active_record"]
|
15
|
+
database_adapters << job["env"]["DATABASE_ADAPTER"]
|
16
|
+
end
|
16
17
|
|
17
18
|
class Matrix
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
def initialize
|
19
|
+
def initialize(active_record_versions, database_adapters)
|
20
|
+
@active_record_versions = active_record_versions
|
21
|
+
@database_adapters = database_adapters
|
23
22
|
@exit_status_code = 0
|
24
23
|
end
|
25
24
|
|
26
|
-
def run
|
25
|
+
def run
|
27
26
|
original_ar_version = `bundle show activerecord`.split("-").last.strip
|
28
|
-
|
29
|
-
|
30
|
-
cmd("ACTIVE_RECORD_VERSION=#{ar_version} bundle update activerecord")
|
31
|
-
|
32
|
-
ADAPTERS.each do |adapter|
|
33
|
-
puts "----> Running tests with ActiveRecord #{ar_version} and #{adapter} adapter"
|
34
|
-
cmd("DATABASE_ADAPTER=#{adapter} ACTIVE_RECORD_VERSION=#{ar_version} bundle exec rake test")
|
35
|
-
end
|
27
|
+
@active_record_versions.each do |ar_version|
|
28
|
+
run_with_active_record_version(ar_version)
|
36
29
|
end
|
37
|
-
|
38
30
|
puts "----> Reverting back to original ActiveRecord version (#{original_ar_version})"
|
39
31
|
cmd("ACTIVE_RECORD_VERSION=#{original_ar_version} bundle update activerecord")
|
40
32
|
|
@@ -47,6 +39,16 @@ class Matrix
|
|
47
39
|
system(cmd)
|
48
40
|
@exit_status_code = $CHILD_STATUS.exitstatus unless $CHILD_STATUS.success?
|
49
41
|
end
|
42
|
+
|
43
|
+
def run_with_active_record_version(ar_version)
|
44
|
+
puts "----> Switching ActiveRecord to version #{ar_version}"
|
45
|
+
cmd("ACTIVE_RECORD_VERSION=#{ar_version} bundle update activerecord")
|
46
|
+
|
47
|
+
@database_adapters.each do |adapter|
|
48
|
+
puts "----> Running tests with ActiveRecord #{ar_version} and #{adapter} adapter"
|
49
|
+
cmd("DATABASE_ADAPTER=#{adapter} ACTIVE_RECORD_VERSION=#{ar_version} bundle exec rake test")
|
50
|
+
end
|
51
|
+
end
|
50
52
|
end
|
51
53
|
|
52
|
-
Matrix.run
|
54
|
+
Matrix.new(active_record_versions.flatten.uniq, database_adapters.uniq).run
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-cte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlado Cingel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|