coverallsapp / github-action

Coveralls Github Action
https://coveralls.io
MIT License
458 stars 76 forks source link

TypeError: Cannot read property 'includes' of undefined #115

Open edgarogh opened 2 years ago

edgarogh commented 2 years ago

Trying to upload a file fails with no information:

# ...
    - name: Upload coverage
      uses: coverallsapp/github-action@1.1.3
      with:
        flag-name: "Unit"
        github-token: ${{ secrets.GITHUB_TOKEN }}
        path-to-lcov: "./target/debug/lcov.info"
# ...
Using lcov file: ./target/debug/lcov.info
/__w/_actions/coverallsapp/github-action/1.1.3/node_modules/coveralls/lib/convertLcovToCoveralls.js:43
  if (file.includes('!')) {
           ^

TypeError: Cannot read property 'includes' of undefined
    at cleanFilePath (/__w/_actions/coverallsapp/github-action/1.1.3/node_modules/coveralls/lib/convertLcovToCoveralls.js:43:12)
    at /__w/_actions/coverallsapp/github-action/1.1.3/node_modules/coveralls/lib/convertLcovToCoveralls.js:106:[19](https://github.com/edgarogh/typed-dialogflow/runs/5720549956?check_suite_focus=true#step:6:19)
    at Array.forEach (<anonymous>)
    at /__w/_actions/coverallsapp/github-action/1.1.3/node_modules/coveralls/lib/convertLcovToCoveralls.js:105:12
    at walkFile (/__w/_actions/coverallsapp/github-action/1.1.3/node_modules/lcov-parse/lib/index.js:106:9)
    at /__w/_actions/coverallsapp/github-action/1.1.3/node_modules/lcov-parse/lib/index.js:115:[20](https://github.com/edgarogh/typed-dialogflow/runs/5720549956?check_suite_focus=true#step:6:20)
    at suppressedCallback (fs.js:[21](https://github.com/edgarogh/typed-dialogflow/runs/5720549956?check_suite_focus=true#step:6:21)5:5)
    at FSReqCallback.oncomplete (fs.js:156:[23](https://github.com/edgarogh/typed-dialogflow/runs/5720549956?check_suite_focus=true#step:6:23))

The lcov file exists according to ls. It was produced by grcov but your action doesn't indicate any parsing errors so I guess it is correct. There's no official information on how to support Rust so I'm using grcov's docs and a bit of guessing to make things work. The error seems to be related to convertLcovToCoveralls but there isn't a way to directly upload the coveralls JSON file produced by grcov (#104).