Skip to content

[BUG] Unexpected working directory since recent update #1767

@Flamefire

Description

@Flamefire

Describe the bug

(I think) since one of the updates at/on v4/v5 the default working directory of the action is changed.
Previously it seemed to always run in $GITHUB_WORKSPACE but now it uses whatever folder is set by the previous step.

This is a problem because the relevant source files will not be found, especially due to a bug in the CLI tool and hence the path fixup are not done and the coverage report will be wrong, e.g. showing many new files that cannot be associated with files in the repo

To Reproduce
Steps to reproduce the behavior:

  1. Create coverage data
  2. Use the codecov-action as a step
  3. Change to a folder that doesn't have a git repo, e.g. /tmp, in the step before that
  4. In my case the coverage file on codecov.io has all absolute paths starting with /__w/

Expected behavior
Default working-directory should likely be $GITHUB_WORKSPACE such that the report is correct.

Regression
Not exactly sure which version did work or if this was a change from GitHub actions triggering this

Product Area
Coverage

Versions

  • OS: Linux
  • Git Host: GitHub
  • CI/CD: GitHub Actions
  • Uploader: codecov-action@v5.3.1

Commit and CI link
CI run

==> Running upload-coverage
      ./codecov --verboseupload-coverage -t <redacted> --fail-on-error --git-service github --sha 34098f5b52a5864e4afcdcf24ed62ad71a4e9487 --disable-search --file coverage.all.info --file coverage.iconv.info --file coverage.icu.info --gcov-executable gcov --name Github Actions
info - 2025-02-13 13:50:54,380 -- ci service found: github-actions
debug - 2025-02-13 13:50:54,382 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.NoVersioningSystem'>
debug - 2025-02-13 13:50:54,384 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.NoVersioningSystem'>
debug - 2025-02-13 13:50:54,384 -- Loading config from /__w/locale/locale/.codecov.yml
debug - 2025-02-13 13:50:54,404 -- Starting upload coverage --- {"verbose": true, "auto_load_params_from": null, "codecov_yml_path": null, "enterprise_url": null, "disable_telem": false, "version": "cli-10.0.1", "command": "upload-coverage", "fail_on_error": true, "git_service": "github", "commit_sha": "34098f5b52a5864e4afcdcf24ed62ad71a4e9487", "disable_search": true, "gcov_executable": "gcov", "name": "Github Actions", "slug": "boostorg/locale", "report_code": "default", "network_root_folder": "/__w/locale/locale", "files_search_root_folder": "/__w/locale/locale", "files_search_exclude_folders": [], "disable_file_fixes": false, "build_code": "13308852149", "build_url": "https://github.com/boostorg/locale/actions/runs/13308852149", "job_code": "CI", "branch": "ci", "pull_request_number": "260", "env_vars": {}, "flags": [], "plugin_names": ["xcode", "gcov", "pycoverage"], "dry_run": false, "use_legacy_uploader": false, "handle_no_reports_found": false, "report_type": "coverage", "network_filter": null, "network_prefix": null, "gcov_args": null, "gcov_ignore": null, "gcov_include": null, "swift_project": null, "parent_sha": null}
debug - 2025-02-13 13:50:54,404 -- Selected preparation plugins --- {"selected_plugins": ["<class 'codecov_cli.plugins.xcode.XcodePlugin'>", "<class 'codecov_cli.plugins.gcov.GcovPlugin'>", "<class 'codecov_cli.plugins.pycoverage.Pycoverage'>"], "cli_config": {}}
debug - 2025-02-13 13:50:54,404 -- Running preparation plugin: <class 'codecov_cli.plugins.xcode.XcodePlugin'>
debug - 2025-02-13 13:50:54,405 -- Running xcode plugin...
warning - 2025-02-13 13:50:54,405 -- xcrun is not installed or can't be found.
debug - 2025-02-13 13:50:54,405 -- Running preparation plugin: <class 'codecov_cli.plugins.gcov.GcovPlugin'>
debug - 2025-02-13 13:50:54,405 -- Running gcov plugin...
warning - 2025-02-13 13:50:54,410 -- No gcov data found.
debug - 2025-02-13 13:50:54,410 -- Running preparation plugin: <class 'codecov_cli.plugins.pycoverage.Pycoverage'>
warning - 2025-02-13 13:50:54,410 -- coverage.py is not installed or can't be found.
debug - 2025-02-13 13:50:54,410 -- Collecting relevant files
info - 2025-02-13 13:50:54,420 -- Found 3 coverage files to report
info - 2025-02-13 13:50:54,420 -- > /__w/locale/locale/coverage.iconv.info
info - 2025-02-13 13:50:54,420 -- > /__w/locale/locale/coverage.all.info
info - 2025-02-13 13:50:54,420 -- > /__w/locale/locale/coverage.icu.info
debug - 2025-02-13 13:50:54,420 -- Selected uploader to use: <class 'codecov_cli.services.upload.upload_sender.UploadSender'>
debug - 2025-02-13 13:50:54,458 -- Sending upload request to Codecov
info - 2025-02-13 13:50:54,941 -- Your upload is now processing. When finished, results will be available at: https://app.codecov.io/github/boostorg/locale/commit/34098f5b52a5864e4afcdcf24ed62ad71a4e9487
debug - 2025-02-13 13:50:54,941 -- Upload request to Codecov complete. --- {"response": {"raw_upload_location": "https://storage.googleapis.com/codecov-production/shelter/github/boostorg%3A%3A%3A%3Alocale/34098f5b52a5864e4afcdcf24ed62ad71a4e9487/d57853bc-c04e-440c-94bf-8fd7a7e4e58b.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EJWQHUGIBILH4J7Q6ZUSCIFNEOLYSNDS7L3B4N5SIBQ2J4YLYE5CRFCD%2F20250213%2Fus%2Fs3%2Faws4_request&X-Amz-Date=20250213T135054Z&X-Amz-Expires=30&X-Amz-SignedHeaders=host&X-Amz-Signature=2d1783818e8156496e87f40a2a1a4cef313c991856bf224ca3c2bfe7297b5a70", "url": "https://app.codecov.io/github/boostorg/locale/commit/34098f5b52a5864e4afcdcf24ed62ad71a4e9487"}}
debug - 2025-02-13 13:50:54,941 -- Sending upload to storage
info - 2025-02-13 13:50:55,191 -- Process Upload complete
debug - 2025-02-13 13:50:55,192 -- Upload result --- {"result": "RequestResult(error=None, warnings=[], status_code=200, text='')"}

Metadata

Metadata

Labels

Area: Report UploadIssues with pre-ingest report uploadingEng Area: Codecov GitHub ActionMediumMedium Priority Issues (to be fixed or re-evaluated in 3 monthsbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions