Comments (11)
@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
gpg
andgpg-agent
needed to be installed to use the action (this is a result of switching fromopengpg
togpg
)- the
root
directory could not be found sincegit
was not present beforecheckout
- subsequently
ca-certificates
here could not properly finish thecheckout
stage without being installed prior - 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.
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.
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.
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:
from codecov-action.
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.
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.
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.
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.
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.
@bdrung sorry going to point you to my PR again that has the changes I needed to get Codecov working
from codecov-action.
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)
- What does "full functionality" mean? HOT 1
- v4 keeps reporting HTTP Error 504 upstream request timeout very often HOT 1
- main Workflow is cruel to forks
- How can I turn off plugins? HOT 4
- I ended up using
- v4 cannot upload luacov report HOT 2
- osv-scanner: general issues HOT 3
- The following uploads failed to process HOT 1
- codecov.exe missing on Windows (randomly) HOT 4
- IsADirectoryError with v4.3.1
- Codecov action fails HOT 10
- Container builds are actually failing
- Can v4 still securely work with pull requests? HOT 12
- v4 fails if a broken symlink is present in the repo HOT 1
- scorecard analysis fails on forks with a different default branch
- codecov tries to fetch oidc token also on PR from fork
- Add support for send-notifications in codecov-action
- Codecov token not found on v4.4.1 HOT 5
- Upload fails on a `macos-14` runner HOT 1
- Upload fails on a `macos-12` runner HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codecov-action.