ci-helper 0.7.0 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 551d0cd85d5c27cb80d637eff25728c151b3b7d5d3484bfbba951f73238c0bef
4
- data.tar.gz: 8b9b6950484b82dffb7683db561114a80f596a887200e25bc56c2c9d062d8ac4
3
+ metadata.gz: 6752c279e742404a6b104c4d4e2bccfaf4c18e17cfb0c6693ce1ddb0ce2b58e1
4
+ data.tar.gz: 4e9960ccc6a0f0bd7b1ecf65a4c6df063cf579cdc71338dddb90248065368332
5
5
  SHA512:
6
- metadata.gz: ad631ef6518703c7d416a262684f42ded724fceaa3646b29cabd3c25875d4be4dc6a54c943464f17c7d745b2c50cee293f90e2fe5ed1736836909f6b328af143
7
- data.tar.gz: 62f003991b68a4d4c0bc95069732ae2d4c5f83741cb059e78063491fd64926da1889432c138eae7e8f3900e53f1fd533e66f5673d7b2ae8b1a164138f36e5edf
6
+ metadata.gz: 3d8da6805297e53be7955d7219289dbece6f2decacdf760b81061e5745c4066a458b8b23ffa64cf06691ac270b00d58259941523e39ed919d056acc28aff0a85
7
+ data.tar.gz: 97b48c63728b3ef1c3a3457a1b5c90e4f2954d250783db38eed9ae6414aeb177cacfca9038d9d46226f6c307f0439a608c38e9bee83ec5999f93d39ba8a2a141
@@ -37,7 +37,7 @@ jobs:
37
37
  strategy:
38
38
  fail-fast: false
39
39
  matrix:
40
- ruby: ["3.0", "3.1", "3.2", "3.3"]
40
+ ruby: ["3.2", "3.3", "3.4"]
41
41
 
42
42
  steps:
43
43
  - uses: actions/checkout@v4
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ inherit_gem:
3
3
 
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 2.7
6
+ TargetRubyVersion: 3.2
7
7
 
8
8
  Naming/MethodParameterName:
9
9
  AllowedNames: ["x", "y", "z"]
data/Gemfile CHANGED
@@ -4,8 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
+ gem "benchmark"
7
8
  gem "bundler"
8
9
  gem "bundler-audit"
10
+ gem "ostruct"
9
11
  gem "pry"
10
12
  gem "rake"
11
13
  gem "rspec"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci-helper (0.7.0)
4
+ ci-helper (0.8.0)
5
5
  colorize (~> 1.1)
6
6
  dry-inflector (~> 1.0)
7
7
  umbrellio-sequel-plugins (~> 0.14)
@@ -21,6 +21,7 @@ GEM
21
21
  tzinfo (~> 2.0)
22
22
  ast (2.4.2)
23
23
  base64 (0.2.0)
24
+ benchmark (0.4.1)
24
25
  bigdecimal (3.1.4)
25
26
  bundler-audit (0.9.1)
26
27
  bundler (>= 1.2.0, < 3)
@@ -40,6 +41,7 @@ GEM
40
41
  method_source (1.0.0)
41
42
  minitest (5.20.0)
42
43
  mutex_m (0.2.0)
44
+ ostruct (0.6.3)
43
45
  parallel (1.23.0)
44
46
  parser (3.2.2.4)
45
47
  ast (~> 2.4.1)
@@ -122,13 +124,16 @@ GEM
122
124
  unicode-display_width (2.5.0)
123
125
 
124
126
  PLATFORMS
125
- arm64-darwin-23
127
+ arm64-darwin
128
+ ruby
126
129
  x86_64-linux
127
130
 
128
131
  DEPENDENCIES
132
+ benchmark
129
133
  bundler
130
134
  bundler-audit
131
135
  ci-helper!
136
+ ostruct
132
137
  pry
133
138
  rake
134
139
  rspec
@@ -137,4 +142,4 @@ DEPENDENCIES
137
142
  simplecov-lcov
138
143
 
139
144
  BUNDLED WITH
140
- 2.4.21
145
+ 2.7.2
data/ci_helper.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "CIHelper is a gem with Continuous Integration helpers for Ruby"
13
13
  spec.homepage = "https://github.com/umbrellio/ci_helper"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.2.0")
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = "https://github.com/umbrellio/ci_helper"
@@ -4,11 +4,12 @@ module CIHelper
4
4
  module Commands
5
5
  class RunSpecs < BaseCommand
6
6
  def call
7
- return if job_files.empty?
7
+ files_to_run = job_files
8
+ return if files_to_run.empty?
8
9
 
9
10
  create_and_migrate_database! if with_database?
10
11
  create_and_migrate_clickhouse_database! if with_clickhouse?
11
- execute("bundle exec rspec #{Shellwords.join(job_files)}")
12
+ execute("bundle exec rspec #{Shellwords.join(files_to_run)}")
12
13
  return 0 unless split_resultset?
13
14
 
14
15
  execute("mv coverage/.resultset.json coverage/resultset.#{job_index}.json")
@@ -22,13 +23,35 @@ module CIHelper
22
23
 
23
24
  def job_files
24
25
  all_files = path.glob("spec/**/*_spec.rb")
26
+
27
+ heavy_files = []
28
+ std_files = []
29
+
30
+ all_files.each do |file|
31
+ relative_path = file.relative_path_from(path).to_s
32
+ if heavy_specs_paths.any? { |pattern| File.fnmatch?(pattern, relative_path) }
33
+ heavy_files << file
34
+ else
35
+ std_files << file
36
+ end
37
+ end
38
+
25
39
  sorted_files =
26
- all_files.map { |x| [x.size, x.relative_path_from(path).to_s] }.sort.map(&:last)
27
- sorted_files.reverse.select.with_index do |_file, index|
40
+ std_files.map { |x| [x.size, x.relative_path_from(path).to_s] }.sort.map(&:last)
41
+ (sorted_files + heavy_files).reverse.select.with_index do |_file, index|
28
42
  (index % job_count) == (job_index - 1)
29
43
  end
30
44
  end
31
45
 
46
+ def heavy_specs_paths
47
+ @heavy_specs_paths ||=
48
+ begin
49
+ File.readlines("spec/heavy_specs.yml", chomp: true)
50
+ rescue
51
+ []
52
+ end
53
+ end
54
+
32
55
  def job_index
33
56
  @job_index ||= options[:node_index]&.to_i || 1
34
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CIHelper
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustAnotherDude
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: colorize
@@ -97,7 +96,6 @@ licenses:
97
96
  metadata:
98
97
  homepage_uri: https://github.com/umbrellio/ci_helper
99
98
  source_code_uri: https://github.com/umbrellio/ci_helper
100
- post_install_message:
101
99
  rdoc_options: []
102
100
  require_paths:
103
101
  - lib
@@ -105,15 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
103
  requirements:
106
104
  - - ">="
107
105
  - !ruby/object:Gem::Version
108
- version: 2.7.0
106
+ version: 3.2.0
109
107
  required_rubygems_version: !ruby/object:Gem::Requirement
110
108
  requirements:
111
109
  - - ">="
112
110
  - !ruby/object:Gem::Version
113
111
  version: '0'
114
112
  requirements: []
115
- rubygems_version: 3.5.22
116
- signing_key:
113
+ rubygems_version: 3.7.2
117
114
  specification_version: 4
118
115
  summary: Continuous Integration helpers for Ruby
119
116
  test_files: []