GithubHelp home page GithubHelp logo

coverallsapp / github-action Goto Github PK

View Code? Open in Web Editor NEW
459.0 10.0 76.0 21.21 MB

Coveralls Github Action

Home Page: https://coveralls.io

License: MIT License

testing code-quality ci code-coverage test-coverage actions

github-action's People

Contributors

afinetooth avatar andremiras avatar cspotcode avatar dependabot[bot] avatar evhaus avatar ibakshay avatar keisukeyamashita avatar kikobeats avatar littleforest avatar lpinca avatar mad-it avatar marcusnotheis avatar mrexox avatar mxcl avatar nickmerwin avatar noxharmonium avatar vtjnash avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-action's Issues

Parallel job coverage is reported on the next run

When running parallel coverage jobs and starting the next run before the previous one is finished, the reports of the previous run show up on the newest one instead of the one they belong to.

Check out trixi-framework/Trixi.jl#400. I started a run with all tests and then removed most of the tests. The newest run reports for example 1d and 3d tests even though I removed them all. The previous run doesn't report any individual coverage jobs, they all show up on the latest run.
Also, the coverage is reported to remain the same although I removed most of the tests.

Here you can clearly see that more coverage reports than test runs show up:
grafik

PR comments are not being added

PR comments are not added to pull requests at all. I double checked the configuration, but it seems fine. I also tried multiple options (compact/detailed view etc.). Here's a screenshot:

67884744-a1106700-fb46-11e9-941a-aefc773af98b

I looked through the source code, but what I've seen so far is that the token is sent to the backend and that's what probably is being used to add a comment, so it looks like there's not much I can fix myself.

Upload failing randomly during getOptions

Most of the time the upload task works fine, but occasionally it'll fail with the following error :

[error] "2020-06-12T05:29:37.644Z"  'error from getOptions'
##[error]Error: Command failed: git cat-file -p 33288473e4a7b9bc7218c6bd08387c30cad92176
fatal: Not a valid object name 33288473e4a7b9bc7218c6bd08387c30cad92176

CI yaml in question : https://github.com/microsoft/azuredatastudio/blob/master/.github/workflows/ci.yml#L57

Failing run : https://github.com/microsoft/azuredatastudio/pull/10879/checks?check_run_id=764299238

Bad response: 500 {"message":"Build processing error.","error":true,"url":""}

First time try this action. Not sure what's wrong...

Run coverallsapp/github-action@master
  with:
    github-token: ***
    path-to-lcov: ./uiowa.DelimitedDataHelper.Tests/TestResults/coverage.info
    coveralls-endpoint: https://coveralls.io
  env:
    DOTNET_ROOT: /opt/hostedtoolcache/dncs/3.0.100/x64
Using lcov file: ./uiowa.DelimitedDataHelper.Tests/TestResults/coverage.info
##[error]Bad response: 500 {"message":"Build processing error.","error":true,"url":""}
##[error]Node run failed with exit code 1

The project url in coveralls.io is https://coveralls.io/github/changhuixu/DelimitedDataFileHelper
Is there anyone could help me?
Thank you.

Fails inconsistently

This plugin succeeds or fails seemingly at random with very little output to follow up on. Below is common output:

  with:
    github-token: ***
    path-to-lcov: ./coverage/lcov.info
    coveralls-endpoint: https://coveralls.io
Using lcov file: ./coverage/lcov.info
##[error]Bad response: 500 {"message":"Build processing error.","error":true,"url":""}
##[error]Node run failed with exit code 1

The same check ran from TravisCI and had no problem completing. This seems like a back end issue. Can you make this action more resilient and less error-prone or more verbose so you can debug it?

Here's a link to a random failure and here's a PR made at roughly the same time that passed.

path-to-lcov does not resolve $GITHUB_WORKSPACE

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

Enable the action to work with more limited access than GITHUB_TOKEN

Because the coveralls action passes the GITHUB_TOKEN to it's backend and the token grants write access, using this action you essentially grant coveralls write access to your repo. This makes it impossible to use the action in organizations that don't allow granting write access to external services.

Please provide an alternative, e.g. by using the regular coveralls repo token.

Lcov file not found

Hi,
I tried to use github-action for doing CI/CD jobs in our application https://github.com/cla-assistant/cla-assistant . However, when performing coveralls step in the job, I am running into an issue like Lcov file not found https://github.com/ibakshay/cla-assistant/blob/master/.github/workflows/nodejs.yml . We are using mocha_istanbul for generating the Lcov file and I can see from the logs that It is generating the file and also the path is correct. Like you have mentioned in the readme file I have also added secret in the repository. Because of this, my build keeps failing and I don't know what I am missing.
Screen Shot 2019-08-14 at 16 18 13

JavaScript heap out of memory

I'm running into an out of memory problem in a larger C++ project (https://github.com/mpreiner/CVC4/runs/351674288). I checked the size of the lcov.info on my machine an it's 95M. The 2048M heap limit seems to be a limitation from node. Is there a way to increase the heap limit for the coveralls action so that it uses all the available memory of the runner?

Support for branches other than master?

Here is my yml that I stole from here

name: Coverage

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

env:
  CARGO_TERM_COLOR: always
  COVERALLS_GIT_BRANCH: main

jobs:
    coverage:
        name: Code Coverage
        runs-on: ubuntu-latest
        steps:
          - name: Checkout repository
            uses: actions/checkout@v2
    
          - name: Install stable toolchain
            uses: actions-rs/toolchain@v1
            with:
              toolchain: stable
              override: true
    
          - name: Run cargo-tarpaulin
            uses: actions-rs/[email protected]
            with:
              args: '--ignore-tests --out Lcov'
    
          - name: upload to Coveralls
            if: ${{ github.event_name == 'push' }}
            uses: coverallsapp/github-action@master
            with:
              github-token: ${{ secrets.GITHUB_TOKEN }}
              path-to-lcov: './lcov.info

I must be doing something dumb because github tells me No jobs were run but I'm not seeing it.

Coveralls isn't sending good names from github actions

When coveralls runs from TravisCI, it has reasonable looking identifiers that are set here:

https://github.com/coverallsapp/github-action/blob/master/node_modules/coveralls/lib/getOptions.js#L21

So, for example, the "service name" is "travis-ci" and that shows up in the coveralls output. For github actions, it's always "GitHub". And the message is always a merge commit instead of the actual commit that is being tested.

One solution might be to set environment variables correctly to trick the coveralls npm module to behave better. For example, in the workflow, it might say:

env:
   TRAVIS: 1
   TRAVIS_JOB_ID: <get a better name here>

It might be possible to find better names than the defaults by looking at the checked out repo and also environment variables.

The better solution is to fix the coveralls npm module which this github action uses and modify it to recognize the eviroment.

Another good solution is to improve both this repo and the coveralls npm module to allow the user to specify those variables from the command line. Then it could be set as arguments to this action and get passed all the way through coveralls to the coveralls server.

Non-Unique value submitted as service_job_id

service_job_id is documented to be unique per job of a parallel build.
Github Actions do not seem to provide anything like that, so leaving it blank is the only way to go about it.

So instead of assigning GITHUB_RUN_ID to COVERALLS_SERVICE_JOB_ID(in https://github.com/coverallsapp/github-action/blob/master/src/run.ts#L48), it should probably be assigned to COVERALLS_SERVICE_NUMBER. Which also matches up with the parallel-finish step submitting it as build_num.

Use action for report generated by php-coveralls/php-coveralls

I try to use this action for php project
Report generated by php-coveralls/php-coveralls and has format xml
I add

- name: Coveralls Parallel
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.github_token }}
        path-to-lcov: ./clover.xml

Step was failed with error 'error from lcovParse: ' 'Failed to parse string'

Coverall requires Jest >= 25.1.7

What

Jest before 25.1.7 reports test coverage with absolute path for SF field which the Coveralls can't handle.
There for, for developers who is using the Jest < 25.1.7 can't use Coveralls.

How should it be?

I want Coveralls to be able to support absolute paths as well.
Some developers including me are using some old versions. Of course, we can start upgrade it but it's better to Coveralls to support all version of Jest.

Thanks in advance.

Ref

jestjs/jest#9773

I just want a percent badge per branch

I was able to do this with Travis, but can't figure out how to get a branch shield that actually stays up to date with the latest commit on that branch.

I have tried many, many different things (each commit is a different attempt).

Notice how the branch badge shown at the top is 100% even though the current state of the branch is 98%. I want the badge to be "live" and always accurate for the current branch.

action fails with error from getOptions

I've seen this happen a handful of times and am not sure how to reproduce. The error output is:

[error] "2019-11-21T22:58:57.209Z"  'error from getOptions'
##[error]Error: Command failed: git cat-file -p <sha>
fatal: Not a valid object name <sha>

My builds always incorrectly report coverage to be 0%

I'm running my tests using Github Actions, and posting the report using the github action in this repo. I'm generating my reports using NYC, and I can confirm the report is there because I cat it right after the tests are done. However, my builds always say the coverage is on 0%, and the file list is empty.
My repo is private so I cannot share any links here, but here are some screenshots to help explain what I see in coveralls:

image

image

image

The build #11 was uploaded using the node-coveralls script directly from my machine, and it worked.

Here are the first 200 lines of my coverage report:

TN:
SF:api-server.js
FN:32,displayMessage
FN:65,(anonymous_1)
FN:66,logResponse
FN:67,(anonymous_3)
FN:74,(anonymous_4)
FN:103,(anonymous_5)
FNF:6
FNH:1
FNDA:0,displayMessage
FNDA:0,(anonymous_1)
FNDA:0,logResponse
FNDA:0,(anonymous_3)
FNDA:0,(anonymous_4)
FNDA:1,(anonymous_5)
DA:26,1
DA:27,1
DA:28,1
DA:29,1
DA:30,1
DA:33,0
DA:35,0
DA:36,0
DA:38,0
DA:39,0
DA:41,0
DA:42,0
DA:44,0
DA:45,0
DA:47,0
DA:48,0
DA:50,0
DA:51,0
DA:54,0
DA:55,0
DA:58,0
DA:61,0
DA:65,1
DA:66,0
DA:67,0
DA:68,0
DA:71,0
DA:74,0
DA:75,0
DA:76,0
DA:77,0
DA:78,0
DA:80,0
DA:81,0
DA:93,0
DA:94,0
DA:103,1
DA:104,1
DA:107,1
DA:108,0
LF:40
LH:9
BRDA:38,0,0,0
BRDA:38,0,1,0
BRDA:41,1,0,0
BRDA:41,1,1,0
BRDA:44,2,0,0
BRDA:44,2,1,0
BRDA:47,3,0,0
BRDA:47,3,1,0
BRDA:50,4,0,0
BRDA:50,4,1,0
BRDA:80,5,0,0
BRDA:80,5,1,0
BRDA:104,6,0,0
BRDA:104,6,1,1
BRDA:107,7,0,0
BRDA:107,7,1,1
BRF:16
BRH:2
end_of_record
TN:
SF:config.test.js
FNF:0
FNH:0
DA:1,1
LF:1
LH:1
BRF:0
BRH:0
end_of_record
TN:
SF:smylen.config.test.js
FNF:0
FNH:0
DA:1,1
LF:1
LH:1
BRF:0
BRH:0
end_of_record
TN:
SF:jobs/JobsQueueFake.js
FN:2,(anonymous_0)
FN:5,(anonymous_1)
FN:8,(anonymous_2)
FN:12,(anonymous_3)
FN:15,(anonymous_4)
FN:18,(anonymous_5)
FN:21,(anonymous_6)
FNF:7
FNH:0
FNDA:0,(anonymous_0)
FNDA:0,(anonymous_1)
FNDA:0,(anonymous_2)
FNDA:0,(anonymous_3)
FNDA:0,(anonymous_4)
FNDA:0,(anonymous_5)
FNDA:0,(anonymous_6)
DA:1,1
DA:9,0
DA:22,0
DA:24,0
DA:26,0
LF:5
LH:1
BRDA:22,0,0,0
BRDA:22,0,1,0
BRF:2
BRH:0
end_of_record
TN:
SF:jobs/helpers/DayGenerater.js
FN:3,(anonymous_0)
FN:7,(anonymous_1)
FN:11,(anonymous_2)
FN:15,(anonymous_3)
FN:19,(anonymous_4)
FN:23,(anonymous_5)
FN:27,(anonymous_6)
FNF:7
FNH:0
FNDA:0,(anonymous_0)
FNDA:0,(anonymous_1)
FNDA:0,(anonymous_2)
FNDA:0,(anonymous_3)
FNDA:0,(anonymous_4)
FNDA:0,(anonymous_5)
FNDA:0,(anonymous_6)
DA:4,0
DA:8,0
DA:12,0
DA:16,0
DA:20,0
DA:24,0
DA:28,0
DA:32,1
LF:8
LH:1
BRF:0
BRH:0
end_of_record
TN:
SF:jobs/processors/AdjustCompanySubscription.js
FN:6,(anonymous_0)
FN:12,(anonymous_1)
FNF:2
FNH:0
FNDA:0,(anonymous_0)
FNDA:0,(anonymous_1)
DA:1,1
DA:2,1
DA:7,0
DA:8,0
DA:9,0
DA:13,0
DA:14,0
DA:15,0
DA:25,1
LF:9
LH:3
BRF:0
BRH:0
end_of_record
TN:
SF:jobs/processors/BulkEnrollment.js

Running the action like this:

- name: Coveralls GitHub Action
      uses: coverallsapp/[email protected]
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        path-to-lcov: ${{ github.workspace }}/api/coverage/lcov.info

Note that path to lcov.info must be correct because if it is not it throws an Error

Any ideas? We have tried everything we saw documented with no luck.

No clear examples for rails project

I'm new to Ruby on Rails, Github Actions and Coveralls, and I can't seem to get this github action working. It doesn't seem to be able to find the coverage report file after I run rspec tests.

My .coveralls.yml file looks like this:


on: [push, "pull_request"]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Set up Ruby 2.6
      uses: actions/setup-ruby@v1
      with:
        ruby-version: 2.6.x

    - name: Run rspec
      run: |
        gem install bundler
        bundle install
        bundle exec rspec spec

    - name: Coveralls
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

What am I missing?

Coverage isn't published within parallel builds

Hello, I am trying to configure coveralls with parallels builds using GitHub Actions with your documentation: https://docs.coveralls.io/parallel-build-webhook

So, As I understand by coverage isn't published due my builds is in pending state (waiting for web hook?)

I've added at last step (finish section) I just call curl with my repo token, and it's returned 404 error, how to configure it properly and could you please add such steps into your documentation

  finish:
    needs: build
    runs-on: ubuntu-latest
    steps:
    - name: Coveralls finished
      run: |
        curl https://coveralls.io/webhook?repo_token=${{ secrets.coveralls }}

Example: https://github.com/pbelskiy/aiojenkins/actions/runs/106594356

Automatic edit/update of comments?

Hi, when using codecov.io it edits coverage report comments on github with updated coverage data, when new commits are pushed to a branch.

Is there any way to achieve a similar effect using Coveralls? I'd even settle for posting an additional comment/report whenever new commits are pushed to the end of a branch on a PR, and coverage data is uploaded for them.

Thanks.

Using for Python code and coverage.py

I was just looking into this for use in the GitHub actions beta, and covering my Python code, but it looks like the coverage tooling for Python doesn't support lcov output (ie running coverage.py via pytest-cov on pytest unittests).

I know that the coveralls Python library can interface with the coveralls.io API, so I'm curious what the suggested solution might be.

Any ideas?

Unexpected input 'flag-name='

Error:

Unexpected input 'flag-name', valid inputs are ['github-token', 'path-to-lcov', 'parallel', 'parallel-finished', 'coveralls-endpoint', 'base-path']

Config:

      - name: coveralls
        uses: coverallsapp/github-action@master
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          flag-name: ci-results.os-${{ matrix.os }}.node-${{ matrix.node }}.mongo-${{ matrix.mongo }}.redis-${{ matrix.redis }}
          parallel: true

Perhaps I should not use @master ? Should I lock it to a specific version?

Parallel invocations should not be failing the build

I'm trying to set up coveralls reporting so that we do multiple parallel invocations, and the final aggregate will pass / fail based on coverage increase/decrease.

Here is where I'm trying to set this up.
TypeStrong/ts-node#1040
The workflow configuration:
https://github.com/TypeStrong/ts-node/blob/a1f5bc8d99f5473ac1716d0c0cc9a5e12f7c0f8a/.github/workflows/continuous-integration.yml#L55-L75

I run a matrix of tests with parallel: true and continue-on-error: true. I have a single parallel-finished: true invocation to aggregate the results. Only the latter should pass/fail.

Am I don't something wrong? Why are the parallel invocations failing my build? I want them to succeed if coverage is successfully reported, ignoring any increase / decrease.

Frustrated with Jenkins/Coverall Setup.

Hello,

We just purchased coveralls for our private Github repository and are running into some configuration issues.

  1. Our language is Python.
  2. We use jenkins to create a .coverage file and this is placed in the root of the system
  3. We can not seem to get the .coverage file to be given to the coveralls.io site.

Does anyone have any setup guides beyond the sparse doc on setting up Jenkins with Coveralls in a private repository setting? We are really getting frustrated.

Thanks.

PR check should report coverage change between the two branches

When I have a PR into the master branch, the GitHub check does not report the coverage change between master and current feature branch. It reports the change from the previous commit in the current branch. It can even result in a decrease when in reality may be a huge increase in coverage for the master branch when merged.

Multiple Coverage files not being merged when uploaded

In my Github actions workflow I am running 3 dotnet test commands as follows

` dotnet test "TestsProject1.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"

dotnet test "TestsProject2.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"

dotnet test "TestsProject3.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov3.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"`

Each of the steps generates its own coverage file.

In my work flow I have a step to upload each of the coverage files as follows (where N in the file name relating to the test step):

  • name: Upload Code Coverage
    uses: coverallsapp/github-action@master
    with:
    github-token: ${{ secrets.github_token }}
    parallel: true
    path-to-lcov: lcovN.info

I then have a coverall finished step as follows:

  • name: Coveralls Finished
    uses: coverallsapp/github-action@master
    with:
    github-token: ${{ secrets.github_token }}
    parallel-finished: true

However what appears to be happening is the 3 files are being uploaded as 3 seperate jobs but the coverage is not being aggregated (i.e. the results I see are from the lcov3.info file).

Is there a way that the files can be uploaded in a single job or is there a way to get the results aggregated?

Merge reports for parallel builds

I'm using this action on a matrix based build https://github.com/websockets/ws/blob/use/github-actions/.github/workflows/ci.yml.

I've defined a test job which is run in parallel and in this job I run the action with the parallel option set to true.

https://github.com/websockets/ws/blob/use/github-actions/.github/workflows/ci.yml#L32

I've also defined a coverage job which is run after all test jobs complete. In this job I run the action with the parallel-finished option set to true.

https://github.com/websockets/ws/blob/use/github-actions/.github/workflows/ci.yml#L40

This works well but it seems results are not aggregated. Am I doing something wrong?

Instructions for Java/JaCoCo

I am using kt3k/coveralls-gradle-plugin now, together with JaCoCo. I am trying to migrate my build to GitHub Actions. Running it with just the GitHub token configured, I get:

Run coverallsapp/github-action@master
Using lcov file: ./coverage/lcov.info
##[error]Lcov file not found.
##[error]Node run failed with exit code 1

Probably I need to point the GitHub action at the XML file generated by JaCoCo, but I don't know how.

[Question] Is it support erlang

My conf:

        - name: Coveralls Parallel
          uses: coverallsapp/github-action@master
          with:
            github-token: ${{ secrets.GITHUB_TOKEN }}
            parallel: true
            path-to-lcov: _build/test/cover/ct.coverdata # optional (default value)

        - name: Coveralls Finished
          uses: coverallsapp/github-action@master
          with:
            github-token: ${{ secrets.GITHUB_TOKEN }}
            parallel-finished: true

Logs in Github Action

Run coverallsapp/github-action@master
/usr/bin/docker exec  4287d6f3ab2b0ff669db5b90bad180d85e07681a4ec95e8d231b383702837bce sh -c "cat /etc/*release | grep ^ID"
Running JavaScript Action with default external tool: node12
Using lcov file: _build/test/cover/ct.coverdata
[error] "2020-01-09T06:15:21.210Z"  'error from lcovParse: ' 'Failed to parse string'
[error] "2020-01-09T06:15:21.210Z"  'input: ' 'L�P\u0000\u0000\u0000Sx��`Na`I��IMa�N�-����OOO-�f�ԏ�/

Expose Flag Name

Currently there is no way to provide a flag_name:
https://github.com/nickmerwin/node-coveralls/blob/2e2b108c68ba1b42901846537c60f714235bc78e/lib/convertLcovToCoveralls.js#L68

attribute to the coverage upload to coveralls.
It would be great if one could provide that property via the action inputs.

Currently no user options are provided to handleInput

github-action/src/run.ts

Lines 101 to 107 in 23ce47a

coveralls.handleInput(file, (err: string, body: string) => {
if(err){
core.setFailed(err);
} else {
core.setOutput('coveralls-api-result', body);
}
});

See:

https://github.com/nickmerwin/node-coveralls/blob/2e2b108c68ba1b42901846537c60f714235bc78e/lib/handleInput.js#L6

request is deprecated

request 2.88.2 is the last version that will be released,

see:
request/request#3142

i can replace the request lib with the native http module,
the code makes it look very straightforward,
just want to make sure nobody else works on this and that i do not miss anything.

Support relative path for "path-to-lcov" argument

What

When I ran the following step after my test, the step failed

- name: Coveralls
      uses: coverallsapp/[email protected]
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        path-to-lcov: ./my/path/relative.info

with the the error Lcov: file not found while if I specify with absolute path, it successes.

- name: Coveralls
      uses: coverallsapp/[email protected]
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        path-to-lcov: ${{ github.workspace }}/path/relative/lcov.info

Documentation Request- Add GitHub Secrets Exmaple

I found the JS/TS documentation a bit confusing as how to integrate the GithubActions/ CI.
I really struggled on how to inject the secret: COVERALLS_REPO_TOKEN

I could not get the coveralls github action to work... not sure if that was my laziness in not wanting to read more on the Github Actions or if there is bug...

I eventually ended up usiung Github Secrets and the solution involves less magic (AKA GitHub Action Magic)

NPM Config Example

package.json full reference is below

{ 
  "scripts":{
     "test": "nyc ts-node test/index.test.ts",
     "reportCov": "nyc report --reporter=text-lcov | coveralls",
}

GitHub Action File Exmaple

nodejs.yml full reference is below

name: Build & Tests
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
jobs:

  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x, 12.x, 14.x]
    steps:
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: CheckOut Latest
      uses: actions/checkout@v2
    - run: npm ci
    - run: npm run lint
    - run: npm run build --if-present
    
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x, 12.x, 14.x]
    steps:
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: CheckOut Latest
      uses: actions/checkout@v2
    - run: npm ci
    - name: Run Tests + Report Coverage
      env: 
        COVERALLS_SERVICE_NAME: 'GitHub CI'
        COVERALLS_GIT_BRANCH: master
        COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
        NODE_COVERALLS_DEBUG: 0 # or 1 for verbsoe
      run: |
        npm run test && 
        npm run reportCov

Notice

All I needed to know when getting started with GitHub Actions was this line in the nodejs.yml
COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}

...Just thought I would drop this in your issues so that any future person searching through here might be able to scratch their own itch on how to integrate their npm run scripts and GitHub Actions/ CI

Anyway nice product and keep up the great work. I am new user, and enjoying it so far.

Referenced Files

For the files in the wild, the two full blown config files are:

Couldn't find a repository matching this job

My config: https://github.com/sweetalert2/sweetalert2/blob/master/.github/workflows/ci.yml#L35-L38

I am sure that the GH_TOKEN secret is present in the repo because semantic-release is using it as well (successfully).

Here's the build with failure: https://github.com/sweetalert2/sweetalert2/runs/262138044

Run coverallsapp/github-action@master
Using lcov file: ./coverage/lcov.info
##[error]Bad response: 422 {"message":"Couldn't find a repository matching this job.","error":true}
##[error]Node run failed with exit code 1

Extra comment in PR

Hi All!

We faced with problem that coveralls produce extra comment in PRs (comments option is disabled via settings). Looks like it works in such way right after we moved to github actions. It will be great, if you can give more info about action behaviour.

Example PR

422 Couldn't find a repository matching this job.

It was fine about 3 hours ago...not sure what I'm doing wrong or is it a server issue?

3 hours ago...I was still using 1.0.1, and it was still successful. Once it failed with this error, I tried to use the updated v1.1.1 version but still same result. The repo is open source, and I only used the basic action config for coveralls.

    - name: Coveralls.io Coverage Upload
      uses: coverallsapp/[email protected]
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

coveralls app and C++ project

Hello,

I'd like to use this action to upload reports to coveralls for a C++ project.
However, the GH env doesn't contain lcov and I've no idea about how to produce the info file required for this (I'm pretty new to GH actions, I started using them 2 days ago actually).
Any hint in this sense? Thank you very much.

Doesn't seem to work when tests not ran from root directory

I use a mono repo, and I've been trying a bunch of test coverage services. Most have an add prefix command that allows me to specify my project's location within the monorepo.

Here is my coverage report (empty):
https://coveralls.io/github/NullVoxPopuli/emberclear

And the build:
https://github.com/NullVoxPopuli/emberclear/commit/f28cffb74a10fd26fbc733351a3c4054f41abaa0/checks?check_suite_id=282980627

And the generated HTML report that I publish with the deploy:
https://emberclear.io/coverage/index.html

And the code I want reporting on lives here: https://github.com/NullVoxPopuli/emberclear/tree/master/packages/frontend

Add support for glob patterns in path-to-lcov

Would it be possible to add support for glob patterns in path-to-lcov?

The tool stack I'm using generates the lcov inside a folder named as a GUID. Not having to specify it would be very helpful.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.