shogo82148 / actions-goveralls Goto Github PK
View Code? Open in Web Editor NEWCoveralls GitHub Action with Go integration powered by mattn/goveralls
License: MIT License
Coveralls GitHub Action with Go integration powered by mattn/goveralls
License: MIT License
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 :)
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?
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
๐คท
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
...
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).
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 :)
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.
Hi @shogo82148 !
I am a new one in go and GitHub actions and I have just tried to connect coveralls to my test repository for coverage shows. But I can not finish it with your action and I do not have any ideas why :) Could you please help me?
This is the link to my pipeline https://github.com/EgorKorol/test-coverage/pull/7/checks?check_run_id=1935799524
Last fail job: https://github.com/ah-its-andy/goconf/runs/6400280203?check_suite_focus=true
Github Action Config: https://github.com/ah-its-andy/goconf/blob/main/.github/workflows/go.yml
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.
Hey Shogo!
This action is awesome, except I would really like to be able to ignore files from coverage reports.
Turns out goveralls actually has support for this, and it would be awesome if you could allow users to pass down files to ignore using the -ignore
flag in goveralls.
See details here:
https://github.com/mattn/goveralls/blob/f6a50649a3849a026ac29cd16b9bdfad0e46424d/goveralls.go#L65
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.
First of all, thanks for your work. This project is so awesome!
I am not sure the Coverage decreased (-0.0%)
issue is caused by actions-goveralls or coveralls, Do you have any idea? Thanks!
The yaml file is here: https://github.com/mozillazg/go-httpheader/blob/master/.github/workflows/main.yml
Link failed ci step https://github.com/Smolevich/remark/runs/551483371?check_suite_focus=true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.