ruby_ci 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_ci/simple_cov/reporting.rb +39 -0
- data/lib/ruby_ci/simple_cov.rb +7 -0
- data/lib/ruby_ci/version.rb +1 -1
- data/lib/ruby_ci.rb +16 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17dfb5e9b470cabfc7fc4a659f3f55c1b2af547a42ee39a11affe56c759ca139
|
4
|
+
data.tar.gz: 78d7a6bf28f59d2d323e3512170a2a13a5e3387d58f9e2346d04a4f39d874063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 410893c69240010c95d1909f450ede519cfb8d714233996319412cf5582dcc51cfc31b017271a57d69b9fc8e76bf6125c6d2b28f3b77fc4c850244445a9bc1eb
|
7
|
+
data.tar.gz: 99e53617f15b76a94b096fec4ba25b6c41f0868746dd6f2c150553c4efe06bf8292ac2bfb198487d6a33a1bbf82ed246630643c1f1b51c09fef2e1e6e67b16cd
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module RubyCI
|
2
|
+
module SimpleCov
|
3
|
+
module Reporting
|
4
|
+
def self.included base
|
5
|
+
base.instance_eval do
|
6
|
+
unless (ENV['RUBY_CI_SECRET_KEY'] || '').empty?
|
7
|
+
def write_last_run(result)
|
8
|
+
::SimpleCov::LastRun.write(result:
|
9
|
+
result.coverage_statistics.transform_values do |stats|
|
10
|
+
round_coverage(stats.percent)
|
11
|
+
end)
|
12
|
+
|
13
|
+
source = {}
|
14
|
+
|
15
|
+
result.source_files.each do |source_file|
|
16
|
+
source[source_file.filename.gsub(root, '')] = source_file.src
|
17
|
+
end
|
18
|
+
|
19
|
+
result_json = {}
|
20
|
+
|
21
|
+
result.as_json.each do |command, data|
|
22
|
+
result_json[command] = data
|
23
|
+
data['coverage'].clone.each do |src, file_data|
|
24
|
+
result_json[command]['coverage'].delete(src)
|
25
|
+
|
26
|
+
file_data['src'] = source[src.gsub(root, '')]
|
27
|
+
|
28
|
+
result_json[command]['coverage'][src.gsub(root, '')] = file_data
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
RubyCI.report_simplecov(result_json.to_json)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/ruby_ci/version.rb
CHANGED
data/lib/ruby_ci.rb
CHANGED
@@ -28,6 +28,22 @@ module RubyCI
|
|
28
28
|
@minitest_ws ||= WebSocket.new('minitest')
|
29
29
|
end
|
30
30
|
|
31
|
+
def report_simplecov(results)
|
32
|
+
data = {
|
33
|
+
build_id: RubyCI.configuration.build_id,
|
34
|
+
run_key: 'simplecov',
|
35
|
+
secret_key: RubyCI.configuration.secret_key,
|
36
|
+
branch: RubyCI.configuration.branch,
|
37
|
+
commit: RubyCI.configuration.commit,
|
38
|
+
commit_msg: RubyCI.configuration.commit_msg,
|
39
|
+
author: RubyCI.configuration.author.to_json,
|
40
|
+
content: results
|
41
|
+
}
|
42
|
+
|
43
|
+
uri = URI('https://fast.ruby.ci/api/runs')
|
44
|
+
res = Net::HTTP.post_form(uri, data)
|
45
|
+
end
|
46
|
+
|
31
47
|
def rspec_await
|
32
48
|
rspec_ws.await
|
33
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_ci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ale ∴
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: console
|
@@ -79,6 +79,8 @@ files:
|
|
79
79
|
- lib/ruby_ci/extract_definitions.rb
|
80
80
|
- lib/ruby_ci/rspec_formatter.rb
|
81
81
|
- lib/ruby_ci/runner_prepend.rb
|
82
|
+
- lib/ruby_ci/simple_cov.rb
|
83
|
+
- lib/ruby_ci/simple_cov/reporting.rb
|
82
84
|
- lib/ruby_ci/version.rb
|
83
85
|
- ruby_ci.gemspec
|
84
86
|
homepage: https://github.com/RubyCI/ruby_ci_gem
|