Git Product home page Git Product logo

Comments (11)

thomasrockhu-codecov avatar thomasrockhu-codecov commented on July 22, 2024 1

@bdrung sorry for the wait here. The answer seems to be that gpg has not been installed. You can see the failure here

I made a PR with some other fixes that were necessary here. Clearly this wasn't an easy migration, and I'll be taking back some of the learnings here to the product team

cc: @rohan-at-sentry
Issues

  1. gpg and gpg-agent needed to be installed to use the action (this is a result of switching from opengpg to gpg)
  2. the root directory could not be found since git was not present before checkout
  3. subsequently ca-certificates here could not properly finish the checkout stage without being installed prior
  4. 2 and 3 are only necessary because the CLI relies on the git repository being pulled down. we should remove that dependency if possible

from codecov-action.

bdrung avatar bdrung commented on July 22, 2024

Thanks. Now I am running into the issue that CODECOV_TOKEN is not set correctly and I don't understand why.

      - name: debug
        run: >
          echo "CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}" | sed 's/./x/g'

shows that the token is set, but the following:

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v4
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
        with:
          fail_ci_if_error: true
          files: ./coverage.xml

has an empty token. See https://github.com/bdrung/bdebstrap/actions/runs/8279831213/job/22655050437

from codecov-action.

drazisil-codecov avatar drazisil-codecov commented on July 22, 2024

Hi @bdrung ,

Based on https://github.com/bdrung/bdebstrap/actions/runs/8279831213/job/22655050437#step:10:2, I don't think the token is populating. I think you might be masking CODECOV_TOKEN: instead.

Is the repo secret named CODECOV_TOKEN exactly in the settings?

from codecov-action.

bdrung avatar bdrung commented on July 22, 2024

Oh, stupid me. You are right. The echo masks CODECOV_TOKEN: .

I configured the CODECOV_TOKEN and do not see were the mistake could be:

bdrung_bdebstrap_settings

from codecov-action.

drazisil-codecov avatar drazisil-codecov commented on July 22, 2024

Hi @bdrung ,

When we say "repo secret" we are referring to under the "secrets and variables" section on the left.

I have a feeling that "environmental secrets" are injected into the workflow differently. I'm not familiar with them, but let me take a look.

from codecov-action.

drazisil-codecov avatar drazisil-codecov commented on July 22, 2024

Hi @bdrung ,

Yes, I believe you need to apply the environment in this case, like so https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#using-an-environment

from codecov-action.

bdrung avatar bdrung commented on July 22, 2024

Thank you very much. Putting it into "Repository secrets" instead of "Environment secrets" was the solution.

Now it fails with a different error:

Traceback (most recent call last):
  File "codecov_cli/main.py", line 81, in <module>
  File "codecov_cli/main.py", line 77, in run
  File "click/core.py", line 1157, in __call__
  File "click/core.py", line 1078, in main
  File "click/core.py", line 1688, in invoke
  File "click/core.py", line 1434, in invoke
  File "click/core.py", line 783, in invoke
  File "click/decorators.py", line 33, in new_func
  File "codecov_cli/commands/upload.py", line 243, in do_upload
  File "codecov_cli/services/upload/__init__.py", line 71, in do_upload_logic
  File "codecov_cli/services/upload/upload_collector.py", line 152, in generate_upload_data
  File "codecov_cli/services/upload/network_finder.py", line 17, in find_files
  File "codecov_cli/helpers/versioning_systems.py", line 111, in list_relevant_files
ValueError: Can't determine root folder
[3946] Failed to execute script 'main' due to unhandled exception!

See https://github.com/bdrung/bdebstrap/actions/runs/8282072264/job/22662063734

from codecov-action.

drazisil-codecov avatar drazisil-codecov commented on July 22, 2024

Hi @bdrung ,

Sounds like it can't find your repo. Please make sure you are running the action after running the checkout step. If your repo is locate in a different location, you may need to pass the root_dir key to the action to tell Codecov where to locate your repo files.

from codecov-action.

bdrung avatar bdrung commented on July 22, 2024

The checkout step is the first step and i am not fiddling with the working directory:

    steps:
      - uses: actions/checkout@v4
      - name: Install dependencies
        run: >
          apt-get update &&
          apt-get install --no-install-recommends --yes black isort pylint
          python3 python3-coverage python3-flake8 python3-ruamel.yaml
          shellcheck
      - name: Run unit tests
        run: |
          python3 -m coverage run -m unittest discover -v
          python3 -m coverage xml
      - name: Install dependencies for Codecov
        run: >
          apt-get install --no-install-recommends --yes
          ca-certificates curl git gpg gpg-agent
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v4
        with:
          fail_ci_if_error: true
          files: ./coverage.xml
          token: ${{ secrets.CODECOV_TOKEN }}

from codecov-action.

thomasrockhu-codecov avatar thomasrockhu-codecov commented on July 22, 2024

@bdrung sorry going to point you to my PR again that has the changes I needed to get Codecov working

from codecov-action.

bdrung avatar bdrung commented on July 22, 2024

Thanks. I found the reason in the diff: git needs to be installed before actions/checkout@v4. Otherwise "The repository will be downloaded using the GitHub REST API".

from codecov-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.