【问题标题】:Codecov integration with circleciCodecov 与 circleci 的集成
【发布时间】:2020-05-25 18:34:07
【问题描述】:

我想将 codecov 与 circleci 集成。 我的 config.yml 文件是这样的:

version: 2.1
orbs:
  ruby: circleci/ruby@0.1.2 
  codecov: codecov/codecov@1.0.2


jobs:
  build:
    docker:
      - image: circleci/ruby:2.6.3-stretch-node
    executor: ruby/default
    steps:
      - checkout
      - run:
          name: Force Bundler Version
          command: |
            sudo gem update --system
            echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
            source $BASH_ENV
            gem install bundler
    steps:
      - codecov/upload:
          file: {{ coverage_report_filepath }} 

我在 CIRCLECI 上遇到构建错误

无法解析 YAML,在“字符串”第 21 行第 5 列中发现重复的关键步骤:步骤

【问题讨论】:

  • 我已经尝试删除 duplications 但结果相同,任何人都可以帮助
  • 如果从第 21 行中删除 steps: 会得到相同的结果吗?
  • @Yakov 我们可以在一份工作中完成所有工作吗?
  • 我关注了这个链接.... (circleci.com/blog/…)
  • 我认为应该在一项工作中并在一个 steps 指令下完成。

标签: ruby-on-rails ruby circleci circleci-2.0


【解决方案1】:

问题是您为同一个工作定义了两次steps

如果您希望 codecov/upload 命令成为构建作业的一部分,那么您只需将其添加到

jobs:
  build:
    docker:
      - image: circleci/ruby:2.6.3-stretch-node
    executor: ruby/default
    steps:
      - checkout
      - run:
          name: Force Bundler Version
          command: |
            sudo gem update --system
            echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
            source $BASH_ENV
            gem install bundler
      - codecov/upload:
          file: {{ coverage_report_filepath }} 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 2022-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-31
    • 2018-12-09
    相关资源
    最近更新 更多