Coder Social home page Coder Social logo

shogo82148 / actions-goveralls Goto Github PK

View Code? Open in Web Editor NEW
51.0 51.0 4.0 215.64 MB

Coveralls GitHub Action with Go integration powered by mattn/goveralls

License: MIT License

TypeScript 53.92% JavaScript 2.00% Makefile 16.80% Go 5.68% Shell 21.60%
coveralls github-actions

actions-goveralls's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar shogo82148 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

Watchers

 avatar  avatar  avatar

actions-goveralls's Issues

"Couldn't find a repository matching this job" after v1.3.0 release

I think something broke after the v1.3.0 release. I'm getting the message

{
    "message": "Couldn't find a repository matching this job.",
    "error": true
}

after this update.

Link to a job that ran today.
Link to a job that ran yesterday with the exact same workflow file and other relevant account settings (I mean, I didn't change any of my GitHub and Coveralls settings).

I don't know if I've done something wrong somewhere. Thanks in advance :)

State of this project compared to `mattn/goveralls`

You are the maintainer of both project shogo82148/actions-goveralls and mattn/goveralls (thank for your work !!).
If I understand correctly, both does the same thing, which project should I use? What's your recommendation?

Shouldn't we deprecated one project in favor of the other?

action-goveralls fails with `go: download go1.22 for linux/amd64: toolchain not available`

since bumping go 1.22 in our project go.mod, actions-goveralls fails

https://github.com/vocdoni/vocdoni-node/actions/runs/8137664043/job/22236741724

Run shogo82148/actions-goveralls@v1
/usr/bin/go env GOROOT
go: downloading go1.22 (linux/amd64)
go: download go1.22 for linux/amd64: toolchain not available
Error: Error: The process '/usr/bin/go' failed with exit code 1

i understand this is due to golang/go#61455

๐Ÿคท

Coverage decreased when migrating from Travis

Hi!

First of all many thanks for all your hard work!!

I am in the process of migrating from TravisCI to Github Actions.
I followed your sample but I am getting a decreased coverage for some reason.

My tests are located in a special test package under api and cli respectively.
Looks like when running tests under api/test or cli/test coverage for statements outside those packages is not produced.

Here are the outputs from Github and Travis.
Travis does not show much but I added the urls to the corresponding Coveralls webpages which show the different results.
(Right now in a test branch pushing to Github triggers CI both Travis and GHActions)

Do you have any idea what's going here?

Github Actions:

Run go test -coverprofile=profile.cov ./...
...
ok  	github.com/pdfcpu/pdfcpu/pkg/api	0.016s	coverage: 0.3% of statements [no tests to run]
ok  	github.com/pdfcpu/pdfcpu/pkg/api/test	81.235s	coverage: [no statements]
...

Coveralls: https://coveralls.io/builds/36045053

TravisCI:

$ $HOME/gopath/bin/goveralls -service=travis-ci
Job #404.1
https://coveralls.io/jobs/72912922
The command "$HOME/gopath/bin/goveralls -service=travis-ci" exited with 0.

Coveralls: https://coveralls.io/builds/36045056

This is what I do locally to get the correct coverage results which corresponds to what I am getting using Travis:

rm $1

set -e

echo mode: set > $1

function internalDeps {

    for p in $(go list -f '{{.Deps}}' $1)
    do
        if [[ $p == github.com/pdfcpu/pdfcpu* ]]; then
            idep=$idep,$p 
        fi
    done
}

echo collecting coverage ...

for q in $(go list ./...)
do
    #echo collecting coverage for $q
    idep=$q
    internalDeps $idep
    if [[ $q == */test ]]; then
        idep=${idep%/test}
    fi
    go test -coverprofile=c.tmp -coverpkg=$idep $q && tail -n +2 c.tmp  >> $1
done

rm c.tmp

go tool cover -html=c.out
Go->  ./htmlcoverage.sh
collecting coverage ...
...
ok  	github.com/pdfcpu/pdfcpu/pkg/api	0.055s	coverage: 0.1% of statements in github.com/pdfcpu/pdfcpu/pkg/api, github.com/pdfcpu/pdfcpu/internal/config, github.com/pdfcpu/pdfcpu/internal/corefont/metrics, github.com/pdfcpu/pdfcpu/pkg/filter, github.com/pdfcpu/pdfcpu/pkg/font, github.com/pdfcpu/pdfcpu/pkg/log, github.com/pdfcpu/pdfcpu/pkg/pdfcpu, github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate, github.com/pdfcpu/pdfcpu/pkg/types [no tests to run]
ok  	github.com/pdfcpu/pdfcpu/pkg/api/test	55.352s	coverage: 71.1% of statements in github.com/pdfcpu/pdfcpu/pkg/api
...

go: cannot find GOROOT directory: /usr/local/go

When testing with tip version of Go at /usr/local/golang-tip, this action fails with:

Run shogo82148/[email protected]
  with:
    path-to-profile: profile.cov
    github-token: ***
    parallel: false
    parallel-finished: false
    job-number: 1
    flag-name: 1
    working-directory: .
/home/runner/work/_actions/shogo82148/actions-goveralls/v1.4.3/bin/goveralls_linux_amd64 -service=github -coverprofile=profile.cov
cannot find file "github.com/qedus/osmpbf/decode.go": can't find "decode.go": go/build: go list github.com/qedus/osmpbf/: exit status 2
go: cannot find GOROOT directory: /usr/local/go

There was a similar report at #178 (comment)

See the the full pipeline at qedus/osmpbf#37 (and in the default branch after that PR is merged).

GITHUB_TOKEN permissions used by this action

At https://github.com/step-security/secure-workflows we are building a knowledge-base (KB) of GITHUB_TOKEN permissions needed by different GitHub Actions. When developers try to set minimum token permissions for their workflows, they can use this knowledge-base instead of trying to research permissions needed by each GitHub Action they use.

Below you can see the KB of your GITHUB Action.

name: 'actions-goveralls'
github-token:
  action-input:
    input: github-token
    is-default: true
  permissions:
    checks: write
    checks-reason: to create a new check based on the results # CHECKOUT: https://github.com/shogo82148/actions-goveralls/blob/8421e834e36ca639db42f46a9c494d1a8cc5c306/action.yml#L6

If you think this information is not accurate, or if in the future your GitHub Action starts using a different set of permissions, please create an issue at https://github.com/step-security/secure-workflows/issues to let us know.

This issue is automatically created by our analysis bot, feel free to close after reading :)

References:

GitHub asks users to define workflow permissions, see https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/ and https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token for securing GitHub workflows against supply-chain attacks.

Setting minimum token permissions is also checked for by Open Source Security Foundation (OpenSSF) Scorecards. Scorecards recommend using https://github.com/step-security/secure-workflows so developers can fix this issue in an easier manner.

question: How to merge results from different actions

Our project contains one job for unit test and the other one for e2e. We want to merge the coverage result, then send them to coveralls.

The current code looks like:

  test:
    name: test
    strategy:
      matrix:
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    env:
      GOPATH: ${{ github.workspace }}/go
    steps:
      - name: Test
        run: make test
      - name: send coverage
        uses: shogo82148/actions-goveralls@v1
        with:
          path-to-profile: coverage.out
          working-directory: ${{ env.GOPATH }}/src/github.com/tensorchord/envd
          flag-name: unit test
          parallel: true
  e2e:
    name: e2e
    strategy:
      matrix:
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    env:
      GOPATH: ${{ github.workspace }}/go
    defaults:
      run:
        working-directory: ${{ env.GOPATH }}/src/github.com/tensorchord/envd
    steps:
      - name: e2e test
        run: make e2e-test
      - name: send coverage
        uses: shogo82148/actions-goveralls@v1
        with:
          path-to-profile: e2e-coverage.out
          working-directory: ${{ env.GOPATH }}/src/github.com/tensorchord/envd
          flag-name: e2e
          parallel: true
  # notifies that all test jobs are finished.
  finish:
    needs:
      - test
      - e2e
    runs-on: ubuntu-latest
    steps:
      - uses: shogo82148/actions-goveralls@v1
        with:
          parallel-finished: true

But it does not work. The coverage of unit test is 6% and the coverage of e2e is 36%. The correct coverage should be 40%+, but we only get 36%, the result of the latter test coverage report.

Version 0.0.8 fails with failed to fetch git ref

Since 0.0.8 is out, the action fails with the following error:

Run goveralls -coverprofile=coverage.out -service=github
  goveralls -coverprofile=coverage.out -service=github
  shell: /usr/bin/bash -e {0}
  env:
    GOROOT: /opt/hostedtoolcache/go/1.16.0/x64
    COVERALLS_TOKEN: ***
failed to fetch git ref "950bd358815a7fb0c9803413b904f94c789c99d8": exit status 128

Version 0.0.7 works.

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.