【问题标题】:codecov.io gives error in combination with Bitbucket pipelinescodecov.io 结合 Bitbucket 管道给出错误
【发布时间】:2017-11-28 16:12:17
【问题描述】:

我确实在 Bitbucket 上建立了一个私人仓库来托管一个 PHP 项目。对于这个项目,我还使用管道集成。

这是我的管道 yaml 文件的内容:

image: php:7.1.4

pipelines:
  default:
    - step:
        script:
          - ./install_xdebug.sh
          - ./install_mailhog.sh
          - ./install_composer.sh
          - composer install
          - vendor/bin/phpunit --coverage-clover=coverage.xml
          - if [ $? -eq 0 ]; then bash <(curl -s https://codecov.io/bash); fi

我可以使用 Xdebug 生成代码覆盖率文件:

Generating code coverage report in Clover XML format ... done

下一部分是将此文件上传到 codecov.io,但这部分失败并出现错误

x> No CI provider detected.
    Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker
    Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox
    project root: .
/dev/fd/63: line 739: git: command not found
/dev/fd/63: line 739: hg: command not found
--> token set from env
    Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage.xml bytes=81581
==> Appending adjustments
    http://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Uploading reports
    url: https://codecov.io
    query: branch=&commit=&build=&build_url=&name=&tag=&slug=&yaml=&service=&flags=&pr=&job=
    -> Pinging Codecov
HTTP 400
missing required properties: [&#39;commit&#39;]

【问题讨论】:

    标签: php bitbucket-pipelines codecov


    【解决方案1】:

    错误信息有点模糊。真正的问题是 php 7.1.4 docker 映像中缺少 git 的安装。我通过在管道配置文件中添加apt-get 命令解决了这个问题。

    apt-get install -y git

    【讨论】:

      猜你喜欢
      • 2022-12-18
      • 2021-08-09
      • 2021-12-18
      • 1970-01-01
      • 2015-05-09
      • 2021-04-17
      • 2021-09-18
      • 2021-07-27
      • 2018-05-26
      相关资源
      最近更新 更多