codecov / codecov-bash

Global coverage report uploader for Codecov
https://codecov.io
Apache License 2.0
234 stars 155 forks source link

Codecov with Travis - Specified coverage file not found. #450

Closed Ferror closed 3 years ago

Ferror commented 3 years ago

Hi! I'm trying to configure Codecov and Travis, but It fails to find the file. I'm sure that the pipeline is creating it. Do you have any idea what might have gone wrong? Also, I tried the default configuration, but it fails too.

Logs

bash <(curl -s https://codecov.io/bash) -f "build/coverage.xml"
  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-1.0.4
==> git version 2.27.0 found
==> curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 
==> Travis CI detected.
    project root: .
--> token set from env
    Yaml found at: codecov.yml
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Appending build variables
    + TRAVIS_OS_NAME
    + 7.4
==> Reading reports
    - file not found at build/coverage.xml
--> No coverage data found.
    Please visit http://docs.codecov.io/docs/supported-languages
    Search for your project's language to learn how to collect reports.

Codecov config file

codecov:
    require_ci_to_pass: true

coverage:
    status:
        project:
            default:
                target: 80%
                threshold: 0%
                base: auto
                paths:
                    - "src"
                if_ci_failed: error
                informational: true
                only_pulls: false
        patch:
            default:
                target: 80%
                threshold: 0%
                base: auto
                if_ci_failed: error
                informational: false
                only_pulls: false
                paths:
                    - "src"
comment:
    layout: "reach, diff, flags, files"
    behavior: default
    require_changes: false
    require_base: false        # [yes :: must have a base report to post]
    require_head: true       # [yes :: must have a head report to post]

Travis Config

language: php
php:
    - '7.4'

install:
    - composer install

jobs:
    include:
        - stage: CI
          script: vendor/bin/phpunit --testsuite unit --coverage-clover=build/coverage.xml
          after_success:
          - bash <(curl -s https://codecov.io/bash) -f "build/coverage.xml"
thomasrockhu commented 3 years ago

@Ferror can you open a ticket in our community boards for this?