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

path-to-lcov does not resolve $GITHUB_WORKSPACE

Open roryprimrose opened this issue 6 years ago • 2 comments

I have been having issues getting the coverallsapp action to resolve the lcov file. I've tried getting dotnet test to write to the expected location but the action still couldn't find it. I assumed this was because the ./ path was being resolved differently across the different actions.

I updated my script to use absolute paths to get around this by specifying the lcov path as $GITHUB_WORKSPACE/coverage/lcov.info. The coverallsapp action still didn't find it when I used the workspace variable. If I put in the value of the variable then it does work.

For example, this fails to resolve the coverage file

    - name: Test
      run: dotnet test -c Release --no-build /p:CollectCoverage=true /p:CoverletOutput="$GITHUB_WORKSPACE/coverage/lcov.info" /p:MergeWith="$GITHUB_WORKSPACE/coverage/lcov.info" /p:CoverletOutputFormat=lcov                                                       

    - name: Coveralls
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.github_token }}
        path-to-lcov: $GITHUB_WORKSPACE/coverage/lcov.info

but this does find the file

    - name: Test
      run: dotnet test -c Release --no-build /p:CollectCoverage=true /p:CoverletOutput="$GITHUB_WORKSPACE/coverage/lcov.info" /p:MergeWith="$GITHUB_WORKSPACE/coverage/lcov.info" /p:CoverletOutputFormat=lcov                                                       

    - name: Coveralls
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.github_token }}
        path-to-lcov: /home/runner/work/Neovolve.CodeAnalysis.ChangeTracking/Neovolve.CodeAnalysis.ChangeTracking/coverage/lcov.info

roryprimrose avatar Nov 07 '19 23:11 roryprimrose

Btw, i was having the same issue (and having a different issue now).

Just FYI, you can use the template parser instead of relying on env vars.

Try this:

path-to-lcov: ${{ github.workspace }}/coverage/lcov.info

An that should force the template parser to replace the full path, and not rely on the action to use ENVs.

eduncan911 avatar Feb 13 '20 17:02 eduncan911

Had the same annoying issue (how much time i wasted trying to configure repos for coveralls over the years, unbelievable) but ${{ github.workspace }}/ worked.

thijstriemstra avatar Feb 07 '21 14:02 thijstriemstra