CircleCI do not update codecov report

Before submitting a topic, please confirm the following

I have searched for similar issues before creating this topic.
I have verified that my repository is using the Codecov GitHub app, if using GitHub
I have validated my codecov.yaml configuration file.
I have filled out the below sections to the best of my ability.

Description

Hi, I want to use orb from CircleCI to upload coverage to codecov, but job dose not upload my test coverage, and if i run commands in local env my tests coverage is uploaded.
It is only doing a command: curl -fLso codecov https://codecov.io/bash and then stops

CI/CD URL

LINK

Codecov Output

#!/bin/bash -eo pipefail
curl -fLso codecov https://codecov.io/bash
CircleCI received exit code 0

Expected Results

Code coverage uploaded in on a Codecov

Actual Results

Uploading did’t happened.

Additional Information

This is my yaml file for circeci

orbs: # declare what orbs we are going to use
  node: circleci/node@3.0.1 # the node orb provides common node-related configuration
  codecov: codecov/codecov@3.0.0

version: 2.1 # using 2.1 provides access to orbs and other features

jobs:
  test:
    executor: node/default
    steps:
      - checkout
      - node/install-packages:
          cache-path: ~/project/node_modules
          override-ci-command: npm install
      - run: npx hardhat compile --showsize --optimizer
      - run: npx hardhat test --optimizer
      - run: npx hardhat coverage
  codecov-job:
    docker:
      # replace with your preferred image
      - image: cimg/base:stable
    steps:
      - codecov/upload:
          file: './coverage.json'
          validate_url: false 
          
workflows:
  jobs-workflow:
    jobs:
      - codecov-job:
          requires:
            - test
      - test

@gruja.work, two things

  1. Codecov is likely not finding any coverage reports to upload because you have separated them into separate jobs. You will need to either combine jobs or use CircleCI’s workspaces.
  2. Please upgrade to the latest version of the Codecov orb, 3.2.3
1 Like

Hi @tom thanks for fast replay, and vary useful documentation, that helps!
Now this upload part is “working” from CircleCI part but still have some issue regarding codecov representation in a UI.

Now here is my circeci yaml file

orbs: # declare what orbs we are going to use
  node: circleci/node@3.0.1 # the node orb provides common node-related configuration
  codecov: codecov/codecov@3.2.3

version: 2.1 # using 2.1 provides access to orbs and other features

jobs:
  test:
    executor: node/default
    steps:
      - checkout
      - node/install-packages:
          cache-path: ~/project/node_modules
          override-ci-command: npm install
      - run: npx hardhat compile --showsize --optimizer
      - run: npx hardhat test --optimizer
      - run:
          name: Create shared coverage outputs folder
          command: mkdir -p /tmp/coverage
      - run: npx hardhat coverage
      - run:
          name: Save coverage
          command: |
            cp coverage.json /tmp/coverage/coverage.json
      - persist_to_workspace:
          root: /tmp/coverage
          paths:
            - coverage.json
  codecov-job:
    docker:
      - image: cimg/base:stable
    steps:
      - attach_workspace:
          at: /tmp/coverage
      - codecov/upload:
          file: '/tmp/coverage/coverage.json'
          
workflows:
  jobs-workflow:
    jobs:
      - codecov-job:
          requires:
            - test
      - test

As you see on screen shot from circleci uploaded coverage.json file from that .yaml file

But i get in codecov ui error: upload is empty

Here is that coverage report file

codecov commit

Ahhh @gruja.work can you add a checkout step before you call - codecov/upload

1 Like

@tom thanks man! it worked!

1 Like