codecov 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +127 -0
- data/LICENSE +21 -0
- data/README.md +111 -0
- data/lib/codecov/uploader.rb +27 -4
- data/lib/codecov/version.rb +1 -1
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3ac8f8595023909dff3989e3b5026a2f3959a1b5264f64abcbef36373535ec9
|
4
|
+
data.tar.gz: dc49c63c9cf98c9052f558c1556bd00963086947580d2eb00deaef201ec31aa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcec7277a8f503f2db6365c1233075d0ecb6727acf2d97e557b40725e0a097735749f64470ea120071e65a6488794875309c19759d7297431f43ea5f6c61100a
|
7
|
+
data.tar.gz: fb195f5011e4baa21f01a1c9131628d009b69ba500b499188bdf8c48b29b8630792307d955dedf4215e1f8ad16478bb5ef4a92cad011cf00e413e847a551153e
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
### `0.5.0`
|
2
|
+
- #137 Place uploader in try/rescue block and add pass_ci_if_error flag
|
3
|
+
|
4
|
+
### `0.4.3`
|
5
|
+
- #135 Shorten coverage message on formatter
|
6
|
+
|
7
|
+
### `0.4.2`
|
8
|
+
- #134 Wrap file creation in try/catch
|
9
|
+
|
10
|
+
### `0.4.1`
|
11
|
+
- #133 Write down to file when using the formatter
|
12
|
+
|
13
|
+
### `0.4.0`
|
14
|
+
- #130 Split uploader from formatter
|
15
|
+
|
16
|
+
### `0.3.0`
|
17
|
+
- #124 Ruby 3.0 support
|
18
|
+
- #125 open simplecov requirement to 0.21.x
|
19
|
+
|
20
|
+
### `0.2.15`
|
21
|
+
- #118 Include codecov/version in the gem
|
22
|
+
|
23
|
+
### `0.2.14`
|
24
|
+
- #107 Add EditorConfig file
|
25
|
+
- #113 Return version constant, don't duplicate version value
|
26
|
+
- #117 Update simplecov dependency versions
|
27
|
+
|
28
|
+
### `0.2.13`
|
29
|
+
- [#105](https://github.com/codecov/codecov-ruby/pull/105) Remove unnecessary dependency for ruby standard gem
|
30
|
+
- [#110](https://github.com/codecov/codecov-ruby/pull/110) Fix GitHub Actions
|
31
|
+
- [#111](https://github.com/codecov/codecov-ruby/pull/111) Fix branch name detection for GitHub Actions CI
|
32
|
+
|
33
|
+
### `0.2.12`
|
34
|
+
- [#102](https://github.com/codecov/codecov-ruby/pull/102) Fix value of params[:pr] when useing CodeBuild
|
35
|
+
|
36
|
+
### `0.2.11`
|
37
|
+
- Add vendor/ to invalid directories
|
38
|
+
|
39
|
+
### `0.2.10`
|
40
|
+
- Adds better logging on error cases
|
41
|
+
- Add more invalid directories in the network
|
42
|
+
|
43
|
+
### `0.2.9`
|
44
|
+
- Remove `String` specific colors
|
45
|
+
- Add support for Codebuild CI
|
46
|
+
|
47
|
+
### `0.2.8`
|
48
|
+
- Remove `colorize` dependency
|
49
|
+
|
50
|
+
### `0.2.7`
|
51
|
+
- Fix for enterprise users unable to upload using the v4 uploader
|
52
|
+
|
53
|
+
### `0.2.6`
|
54
|
+
- Fix issue with `push` events on GitHub Actions
|
55
|
+
|
56
|
+
### `0.2.5`
|
57
|
+
- Revert single use of VERSION
|
58
|
+
|
59
|
+
### `0.2.4`
|
60
|
+
- Adds support for GitHub Actions CI
|
61
|
+
|
62
|
+
### `0.2.3`
|
63
|
+
- Support uploads for jruby 9.1 and 9.2
|
64
|
+
|
65
|
+
### `0.2.2`
|
66
|
+
- Handle SocketError and better error handling of v4 failures
|
67
|
+
|
68
|
+
### `0.2.1`
|
69
|
+
- Properly handle 400 cases when using the v4 endpoint
|
70
|
+
|
71
|
+
### `0.2.0`
|
72
|
+
- move to the v4 upload endpoint with the v2 as a fallback
|
73
|
+
|
74
|
+
### `0.1.20`
|
75
|
+
- fix critical upload issues on V2 endpoint
|
76
|
+
|
77
|
+
### `0.1.19`
|
78
|
+
- fix colorize
|
79
|
+
|
80
|
+
### `0.1.18`
|
81
|
+
- refactor and move to use v2 endpoint
|
82
|
+
- use Timeout::Error
|
83
|
+
|
84
|
+
### `0.1.17`
|
85
|
+
- refactor upload method and add more logging
|
86
|
+
|
87
|
+
### `0.1.10`
|
88
|
+
- update numerous ci environments
|
89
|
+
- dont fail if cannot upload to codecov
|
90
|
+
|
91
|
+
### `0.1.3`
|
92
|
+
- add buildkite
|
93
|
+
|
94
|
+
### `0.1.2`
|
95
|
+
- add slug argument
|
96
|
+
- use slug for uploading
|
97
|
+
- add Accept to uploads
|
98
|
+
|
99
|
+
### `0.1.1`
|
100
|
+
- fix #6, thanks @justmatt
|
101
|
+
- add semaphore thread number
|
102
|
+
|
103
|
+
### `0.1.0`
|
104
|
+
- added more CircleCI env
|
105
|
+
|
106
|
+
### `0.0.11`
|
107
|
+
- send AppVeyor pr# with reports
|
108
|
+
|
109
|
+
### `0.0.10`
|
110
|
+
- fix AppVeyor for public repos
|
111
|
+
|
112
|
+
### `0.0.9`
|
113
|
+
- remove tmp.json creation
|
114
|
+
|
115
|
+
### `0.0.8`
|
116
|
+
- added more jenkins environment references
|
117
|
+
|
118
|
+
### `0.0.7`
|
119
|
+
- added GitLab CI Runner support
|
120
|
+
|
121
|
+
### `0.0.5`
|
122
|
+
- added line messages by @coderanger
|
123
|
+
- fixed skip lines during reporting by @coderanger
|
124
|
+
|
125
|
+
### `0.0.4`
|
126
|
+
- added more test
|
127
|
+
- added more CI providers
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Codecov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
# Codecov Ruby Uploader
|
2
|
+
|
3
|
+
## DEPRECATION WARNING
|
4
|
+
|
5
|
+
All versions of the Ruby uploader prior to `0.2.0` will no longer be supported
|
6
|
+
and will be removed from public use on or after *2020-08-17*.
|
7
|
+
Please upgrade to the latest versions to continue using this uploader.
|
8
|
+
|
9
|
+
[![Codecov](https://codecov.io/github/codecov/codecov-ruby/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-ruby?branch=master)
|
10
|
+
[![Gem Version](https://badge.fury.io/rb/codecov.svg)](https://rubygems.org/gems/codecov)
|
11
|
+
[![Build Status](https://secure.travis-ci.org/codecov/codecov-ruby.svg?branch=master)](http://travis-ci.org/codecov/codecov-ruby)
|
12
|
+
[![Codecov](https://circleci.com/gh/codecov/codecov-ruby.svg?style=svg)](https://circleci.com/gh/codecov/codecov-ruby)
|
13
|
+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-ruby.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-ruby?ref=badge_shield)
|
14
|
+
|
15
|
+
|
16
|
+
[Codecov.io](https://codecov.io/) upload support for Ruby.
|
17
|
+
|
18
|
+
## Quick Start
|
19
|
+
|
20
|
+
Add to your `Gemfile`:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
gem 'codecov', require: false, group: 'test'
|
24
|
+
```
|
25
|
+
|
26
|
+
Add to the top of your `tests/helper.rb` file:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'simplecov'
|
30
|
+
SimpleCov.start
|
31
|
+
|
32
|
+
require 'codecov'
|
33
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
34
|
+
```
|
35
|
+
|
36
|
+
Add CI Environment Variable:
|
37
|
+
|
38
|
+
```sh
|
39
|
+
CODECOV_TOKEN="your repo token"
|
40
|
+
```
|
41
|
+
|
42
|
+
Find you repo token on your repo page at [codecov.io](https://codecov.io).
|
43
|
+
Repo tokens are **not** required for public repos on Travis-Ci, CircleCI, or AppVeyor CI.
|
44
|
+
|
45
|
+
## Supported CIs
|
46
|
+
| CI/CD |
|
47
|
+
| ----- |
|
48
|
+
| [AppVeyor CI](https://www.appveyor.com/) |
|
49
|
+
| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) |
|
50
|
+
| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) |
|
51
|
+
| [Bitrise CI](https://www.bitrise.io/) |
|
52
|
+
| [Buildkite CI](https://buildkite.com/) |
|
53
|
+
| [CodeBuild CI](https://aws.amazon.com/codebuild/) |
|
54
|
+
| [CodePipeline](https://aws.amazon.com/codepipeline/) |
|
55
|
+
| [Circle CI](https://circleci.com/) |
|
56
|
+
| [Codeship CI](https://codeship.com/) |
|
57
|
+
| [Drone CI](https://drone.io/) |
|
58
|
+
| [GitLab CI](https://docs.gitlab.com/ee/ci/) |
|
59
|
+
| [Heroku CI](https://www.heroku.com/continuous-integration) |
|
60
|
+
| [Jenkins CI](https://www.jenkins.io/) |
|
61
|
+
| [Semaphore CI](https://semaphoreci.com/) |
|
62
|
+
| [Shippable](https://www.shippable.com/) |
|
63
|
+
| [Solano CI](https://xebialabs.com/technology/solano-ci/) |
|
64
|
+
| [TeamCity CI](https://www.jetbrains.com/teamcity/) |
|
65
|
+
| [Travis CI](https://travis-ci.org/) |
|
66
|
+
| [Wercker CI](https://devcenter.wercker.com/) |
|
67
|
+
|
68
|
+
## Advanced Usage
|
69
|
+
|
70
|
+
#### Submit only in CI example
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
if ENV['CI'] == 'true'
|
74
|
+
require 'codecov'
|
75
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
76
|
+
end
|
77
|
+
```
|
78
|
+
|
79
|
+
## Useful Links
|
80
|
+
|
81
|
+
[FAQ](https://docs.codecov.io/docs/frequently-asked-questions)
|
82
|
+
[Recipe List](https://docs.codecov.io/docs/common-recipe-list)
|
83
|
+
[Error Reference](https://docs.codecov.io/docs/error-reference)
|
84
|
+
[Changelog](./CHANGELOG.md)
|
85
|
+
[Support](https://codecov.io/support)
|
86
|
+
[Community Boards](https://community.codecov.io)
|
87
|
+
|
88
|
+
## Caveats
|
89
|
+
|
90
|
+
1. There are known issues when `Simplecov.track_files` is enabled. We recommend that you require all code files in your tests so that SimpleCov can provide Codecov with properly mapped coverage report metrics. [codecov/support#133]( https://github.com/codecov/support/issues/133)
|
91
|
+
- https://github.com/colszowka/simplecov/blob/master/README.md#default-root-filter-and-coverage-for-things-outside-of-it
|
92
|
+
2. `git` must be installed.
|
93
|
+
- https://github.com/codecov/codecov-ruby/blob/5e3dae3/lib/codecov.rb#L284-L295
|
94
|
+
|
95
|
+
## Maintainers
|
96
|
+
|
97
|
+
- [thomasrockhu](https://github.com/thomasrockhu)
|
98
|
+
|
99
|
+
## Enterprise
|
100
|
+
|
101
|
+
For companies using Codecov Enterprise you will need to specify the following parameters:
|
102
|
+
|
103
|
+
```sh
|
104
|
+
CODECOV_URL="https://codecov.mycompany.com"
|
105
|
+
CODECOV_SLUG="owner/repo"
|
106
|
+
CODECOV_TOKEN="repository token or global token"
|
107
|
+
```
|
108
|
+
|
109
|
+
|
110
|
+
## License
|
111
|
+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-ruby.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-ruby?ref=badge_large)
|
data/lib/codecov/uploader.rb
CHANGED
@@ -37,7 +37,17 @@ class Codecov::Uploader
|
|
37
37
|
|
38
38
|
display_header
|
39
39
|
ci = detect_ci
|
40
|
-
|
40
|
+
|
41
|
+
begin
|
42
|
+
response = upload_to_codecov(ci, report)
|
43
|
+
rescue StandardError => e
|
44
|
+
puts `#{e.message}`
|
45
|
+
puts `#{e.backtrace.join("\n")}`
|
46
|
+
raise e unless ::SimpleCov.pass_ci_if_error
|
47
|
+
|
48
|
+
response = false
|
49
|
+
end
|
50
|
+
|
41
51
|
if response == false
|
42
52
|
report['result'] = { 'uploaded' => false }
|
43
53
|
return report
|
@@ -180,16 +190,29 @@ class Codecov::Uploader
|
|
180
190
|
params[:commit] = ENV['CIRCLE_SHA1']
|
181
191
|
when CODEBUILD
|
182
192
|
# https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
|
193
|
+
# To use CodePipeline as CodeBuild source which sets no branch and slug variable:
|
194
|
+
#
|
195
|
+
# 1. Set up CodeStarSourceConnection as source action provider
|
196
|
+
# https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html
|
197
|
+
# 2. Add a Namespace to your source action. Example: "CodeStar".
|
198
|
+
# https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-variables.html#reference-variables-concepts-namespaces
|
199
|
+
# 3. Add these environment variables to your CodeBuild action:
|
200
|
+
# - CODESTAR_BRANCH_NAME: #{CodeStar.BranchName}
|
201
|
+
# - CODESTAR_FULL_REPOSITORY_NAME: #{CodeStar.FullRepositoryName} (optional)
|
202
|
+
# https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeBuild.html#action-reference-CodeBuild-config
|
203
|
+
#
|
204
|
+
# PRs are not supported with CodePipeline.
|
183
205
|
params[:service] = 'codebuild'
|
184
|
-
params[:branch] = ENV['CODEBUILD_WEBHOOK_HEAD_REF']
|
206
|
+
params[:branch] = ENV['CODEBUILD_WEBHOOK_HEAD_REF']&.split('/')&.[](2) || ENV['CODESTAR_BRANCH_NAME']
|
185
207
|
params[:build] = ENV['CODEBUILD_BUILD_ID']
|
186
208
|
params[:commit] = ENV['CODEBUILD_RESOLVED_SOURCE_VERSION']
|
187
209
|
params[:job] = ENV['CODEBUILD_BUILD_ID']
|
188
|
-
params[:slug] = ENV['CODEBUILD_SOURCE_REPO_URL']
|
189
|
-
params[:pr] = if ENV['CODEBUILD_SOURCE_VERSION']
|
210
|
+
params[:slug] = ENV['CODEBUILD_SOURCE_REPO_URL']&.match(/.*github.com\/(?<slug>.*).git/)&.[]('slug') || ENV['CODESTAR_FULL_REPOSITORY_NAME']
|
211
|
+
params[:pr] = if ENV['CODEBUILD_SOURCE_VERSION'] && !(ENV['CODEBUILD_INITIATOR'] =~ /codepipeline/)
|
190
212
|
matched = ENV['CODEBUILD_SOURCE_VERSION'].match(%r{pr/(?<pr>.*)})
|
191
213
|
matched.nil? ? ENV['CODEBUILD_SOURCE_VERSION'] : matched['pr']
|
192
214
|
end
|
215
|
+
params[:build_url] = ENV['CODEBUILD_BUILD_URL']
|
193
216
|
when CODESHIP
|
194
217
|
# https://www.codeship.io/documentation/continuous-integration/set-environment-variables/
|
195
218
|
params[:service] = 'codeship'
|
data/lib/codecov/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codecov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Peak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: simplecov
|
@@ -122,6 +122,9 @@ executables: []
|
|
122
122
|
extensions: []
|
123
123
|
extra_rdoc_files: []
|
124
124
|
files:
|
125
|
+
- CHANGELOG.md
|
126
|
+
- LICENSE
|
127
|
+
- README.md
|
125
128
|
- lib/codecov.rb
|
126
129
|
- lib/codecov/formatter.rb
|
127
130
|
- lib/codecov/uploader.rb
|
@@ -129,7 +132,12 @@ files:
|
|
129
132
|
homepage: https://github.com/codecov/codecov-ruby
|
130
133
|
licenses:
|
131
134
|
- MIT
|
132
|
-
metadata:
|
135
|
+
metadata:
|
136
|
+
bug_tracker_uri: https://github.com/codecov/codecov-ruby/issues
|
137
|
+
changelog_uri: https://github.com/codecov/codecov-ruby/blob/v0.5.0/CHANGELOG.md
|
138
|
+
documentation_uri: http://www.rubydoc.info/gems/codecov/0.5.0
|
139
|
+
homepage_uri: https://github.com/codecov/codecov-ruby
|
140
|
+
source_code_uri: https://github.com/codecov/codecov-ruby
|
133
141
|
post_install_message:
|
134
142
|
rdoc_options: []
|
135
143
|
require_paths:
|