Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error in codecov work #198

Closed
mianasbat opened this issue Jan 8, 2021 · 1 comment · Fixed by codecov/codecov-bash#402
Closed

Getting error in codecov work #198

mianasbat opened this issue Jan 8, 2021 · 1 comment · Fixed by codecov/codecov-bash#402
Assignees

Comments

@mianasbat
Copy link

Hi,
I have a repository scikit-surgerydocker and I am trying to activate code coverage according to the example code you have given on the repo.
My repo is public and feel free to have a look.

Here is my workflow code.

name: main
on:
  push:
    branches:
      - 15-add-code-coverage
jobs:
  run:
    runs-on: ubuntu-latest
    env:
      PYTHON: '3.6'
    steps:
    - uses: actions/checkout@master
    - name: Setup Python
      uses: actions/setup-python@master
      with:
        python-version: 3.6
    - name: Generate coverage report
      run: |
        pip install pytest
        pip install pytest-cov
        cd tests
        python3 -m pytest --cov-report xml --cov project
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        files: ./coverage1.xml,./coverage2.xml
        directory: ./coverage/reports/
        flags: unittests
        env_vars: OS,PYTHON
        name: codecov-umbrella
        fail_ci_if_error: true
        path_to_write_report: ./coverage/codecov_report.txt
        verbose: true%

here is the error I get

+ say '\033[0;90m==>\033[0m Copying upload file to ./coverage/codecov_report.txt'
+ echo -e '\033[0;90m==>\033[0m Copying upload file to ./coverage/codecov_report.txt'
+ cp /tmp/codecov.PdjspK ./coverage/codecov_report.txt
==> Copying upload file to ./coverage/codecov_report.txt
cp: cannot create regular file './coverage/codecov_report.txt': No such file or directory
Error: Codecov failed with the following error: The process '/bin/bash' failed with exit code 1

More details here
Could you please help.

@mianasbat
Copy link
Author

I made it work using the following code

name: main
on:
  push:
    branches:
      - main
jobs:
  run:
    runs-on: ubuntu-latest
    env:
      PYTHON: '3.6'
    steps:
    - uses: actions/checkout@master
    - name: Setup Python
      uses: actions/setup-python@master
      with:
        python-version: 3.6
    - name: Generate coverage report
      run: |
        pip install pytest
        pip install pytest-cov
        cd tests
        python3 -m pytest --cov-report xml --cov project
        mv coverage.xml ../
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
      with:
        fail_ci_if_error: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants