codecov-action
codecov-action copied to clipboard
Does not work inside of Docker
This action doesn't appear to work inside of Docker (Alpine Linux):
Error: Codecov: Failed to properly upload: There was an error when attempting to execute the process '/__w/_actions/codecov/codecov-action/v2.0.3/dist/codecov'. This may indicate the process failed to start. Error: spawn /__w/_actions/codecov/codecov-action/v2.0.3/dist/codecov ENOENT
I'm having the same issue. Here is my yml file
`name: CI - Frontend
Controls when the workflow will run
on:
Triggers the workflow on push or pull request events but only for the master branch
push: branches: [ master ] pull_request: branches: [ master ]
Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: frontend:
Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: node:10-alpine
steps:
- name: Checkout code from repository
uses: actions/checkout@v2
- name: Setup Node environment
uses: actions/setup-node@v2
with:
node-version: '10'
- name: Install npm packages
run: |
cd frontend/
npm install
- name: Run tests
run: |
cd frontend/
npm test --ci --coverage
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-frontend
verbose: true
directory: ./frontend/
root_dir: ./frontend/
files: clover.xml,coverage-final.json,lcov.info
commit_parent: ${{ github.event.pull_request.head.sha }}
`
I have another CI pipeline that has a similar Codecov setup, but with a python:3.9-slim container, instead of the node:10-alpine container and that works fine.
python:3.9-slim is Debian whereas node:10-alpine is Alpine. So maybe this is Alpine Linux related more than Docker?
I'm having the same problem when using this action on my test container (https://github.com/LorenzoLeonardini/php-test-env), which is in fact using alpine
Same here with codecov/codecov-action@v2, see full log at https://github.com/merlinran/acorn-precision-farming-rover/runs/4453816306?check_suite_focus=true#step:5:10 . codecov/codecov-action@v1 runs fine(log).
If you see linux OS detected, the action will use an uploader binary that links against glibc. You can either add gcompat to make it work or set the input os: alpine to use a proper binary.
If you are still experiencing this issue, please open a topic on our community boards