codecov-action icon indicating copy to clipboard operation
codecov-action copied to clipboard

Does not work inside of Docker

Open Jamesking56 opened this issue 2 years ago • 5 comments

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

Jamesking56 avatar Sep 26 '21 20:09 Jamesking56

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.

aalexcomas11 avatar Sep 29 '21 17:09 aalexcomas11

python:3.9-slim is Debian whereas node:10-alpine is Alpine. So maybe this is Alpine Linux related more than Docker?

Jamesking56 avatar Sep 30 '21 08:09 Jamesking56

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

LorenzoLeonardini avatar Oct 13 '21 15:10 LorenzoLeonardini

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).

merlinran avatar Dec 08 '21 17:12 merlinran

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.

cschramm avatar Feb 17 '22 10:02 cschramm

If you are still experiencing this issue, please open a topic on our community boards

thomasrockhu-codecov avatar Mar 01 '23 19:03 thomasrockhu-codecov