pioz
January 27, 2021, 10:37pm
1
I’m trying to upload coverage report to codecov via github actions.
Here my github action:
- name: Run tests
run: bundle exec rake test
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage/.resultset.json
I have a codecov.yml
file in the root of my project like this:
fixes:
- '/home/runner/work/chess/chess/::'
The report seems to be uploaded correctly to Codecov but when I open the Codecov report page I see the message “There was an error processing coverage reports.”
I attach here some screenshots:
Any idea to solve this?
tom
January 27, 2021, 10:55pm
4
@pioz , can you please link to the PR and Codecov link?
pioz
January 27, 2021, 11:29pm
5
tom
January 27, 2021, 11:47pm
6
pioz
January 27, 2021, 11:49pm
7
Oh, yes… I have removed because it had no effect.
tom
January 27, 2021, 11:51pm
8
Can you link to the commit with the file?
pioz
January 27, 2021, 11:54pm
9
I dont think is a problem with the paths. Here complete log of the action:
==> git version 2.30.0 found
==> curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
==> GitHub Actions detected.
project root: .
Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./coverage/.resultset.json bytes=12893
==> Appending adjustments
https://docs.codecov.io/docs/fixing-reports
+ Found adjustments
==> Gzipping contents
8.0K /tmp/codecov.72OlJZ.gz
==> Uploading reports
url: https://codecov.io
query: branch=master&commit=baa3986aaa95460d9614eef0f1c6dca6843cca2a&build=516440007&build_url=http%3A%2F%2Fgithub.com%2Fpioz%2Fchess%2Factions%2Fruns%2F516440007&name=&tag=&slug=pioz%2Fchess&service=github-actions&flags=&pr=&job=Ruby&cmd_args=n,F,Q,f
-> Pinging Codecov
https://codecov.io/upload/v4?package=github-action-20210115-cec3c92&token=secret&branch=master&commit=baa3986aaa95460d9614eef0f1c6dca6843cca2a&build=516440007&build_url=http%3A%2F%2Fgithub.com%2Fpioz%2Fchess%2Factions%2Fruns%2F516440007&name=&tag=&slug=pioz%2Fchess&service=github-actions&flags=&pr=&job=Ruby&cmd_args=n,F,Q,f
-> Uploading to
https://storage.googleapis.com/codecov/v4/raw/2021-01-27/98BFC3C23F672DE4BC9E4576851F92C1/baa3986aaa95460d9614eef0f1c6dca6843cca2a/d0e7ddb5-28eb-4da2-bc3a-082616f087d3.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20210127%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20210127T232025Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=266353e3fa6963091b78373e8429e0d4c4455f126f9ea54da1e41bc6bbd152d6
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 5761 0 0 100 5761 0 27433 --:--:-- --:--:-- --:--:-- 27433
-> View reports at https://codecov.io/github/pioz/chess/commit/baa3986aaa95460d9614eef0f1c6dca6843cca2a
As you can see the file was uploaded correctly.
Anyway, I’ve just added the file: Add codecov.yml · pioz/chess@8a76736 · GitHub
tom
January 28, 2021, 12:03am
10
@pioz , it looks like it’s picking up resultset.json
which is not really a stable file . Can you try using the Codecov Ruby formatter or the SimpleCov Cobertura formatter
pioz
January 28, 2021, 12:39am
11
I cannot use GitHub - codecov/codecov-ruby: Ruby uploader for Codecov cause when I run the test, it upload also the report, see Split formatter and uploader · Issue #32 · codecov/codecov-ruby · GitHub and it is a pity.
It works with SimpleCov Cobertura formatter .
But it would be great if codecov supported the default simplecov ./coverage/.resultset.json
file! No need extra dependencies.
tom
January 28, 2021, 12:49am
12
@pioz , hmm… the formatter has been split from the uploader. You can use Codecov::SimpleCov::Formatter
.
pioz
January 28, 2021, 12:51am
13
require 'net/http'
require 'simplecov'
require 'zlib'
require_relative 'codecov/formatter'
require_relative 'codecov/uploader'
class SimpleCov::Formatter::Codecov
def format(result, disable_net_blockers = true)
report = Codecov::SimpleCov::Formatter.new.format(result)
Codecov::Uploader.upload(report, disable_net_blockers)
end
end
The upload method is always called, I think.
tom
January 28, 2021, 12:51am
14
@pioz , however, I see your point. We’ll work to remove more dependencies.
1 Like
tom
January 28, 2021, 12:53am
15
@pioz , that’s SimpleCov::Formatter::Codecov
, which continues to provide backwards compatibility. To see just the formatter, you can see us deploy it on the bash uploader and here .