{"id":13411305,"url":"https://github.com/mattn/goveralls","last_synced_at":"2025-05-14T11:12:43.743Z","repository":{"id":8082153,"uuid":"9495505","full_name":"mattn/goveralls","owner":"mattn","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-26T12:28:51.000Z","size":313,"stargazers_count":790,"open_issues_count":18,"forks_count":136,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-05-14T02:26:12.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"shogo82148","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2013-04-17T10:58:40.000Z","updated_at":"2025-05-09T06:29:27.000Z","dependencies_parsed_at":"2024-01-08T15:01:10.551Z","dependency_job_id":"c3dac276-e54d-4380-8c5c-f5a62d8c89a0","html_url":"https://github.com/mattn/goveralls","commit_stats":{"total_commits":264,"total_committers":77,"mean_commits":"3.4285714285714284","dds":0.7840909090909091,"last_synced_commit":"3fa30c79c837ed9c3b8447dcd0ba06d231661b9f"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgoveralls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgoveralls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgoveralls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgoveralls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattn","download_url":"https://codeload.github.com/mattn/goveralls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129526,"owners_count":22019628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:12.799Z","updated_at":"2025-05-14T11:12:43.661Z","avatar_url":"https://github.com/mattn.png","language":"Go","funding_links":["https://github.com/sponsors/shogo82148"],"categories":["Continuous Integration","持续集成","Go","持续集成`持续集成的辅助工具`","\u003cspan id=\"持续集成-continuous-integration\"\u003e持续集成 Continuous Integration\u003c/span\u003e","Uncategorized","持续集成(CI)"],"sub_categories":["Standard CLI","标准CLI","Advanced Console UIs","标准 CLI","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"goveralls\n=========\n\n[Go](http://golang.org) integration for [Coveralls.io](http://coveralls.io)\ncontinuous code coverage tracking system.\n\n# Installation\n\n`goveralls` requires a working Go installation (Go-1.13 or higher).\n\n```bash\n$ go install github.com/mattn/goveralls@latest\n```\n\n\n# Usage\n\nFirst you will need an API token.  It is found at the bottom of your\nrepository's page when you are logged in to Coveralls.io.  Each repo has its\nown token.\n\n```bash\n$ cd $GOPATH/src/github.com/yourusername/yourpackage\n$ goveralls -repotoken your_repos_coveralls_token\n```\n\nYou can set the environment variable `$COVERALLS_TOKEN` to your token so you do\nnot have to specify it at each invocation.\n\n\nYou can also run this reporter for multiple passes with the flag `-parallel` or\nby setting the environment variable `COVERALLS_PARALLEL=true` (see [coveralls\ndocs](https://docs.coveralls.io/parallel-build-webhook) for more details).\n\n\n# Continuous Integration\n\nThere is no need to run `go test` separately, as `goveralls` runs the entire\ntest suite.\n\n## GitHub Actions\n\n[shogo82148/actions-goveralls](https://github.com/marketplace/actions/actions-goveralls) is available on GitHub Marketplace.\nIt provides the shorthand of the GitHub Actions YAML configure.\n\n```yaml\nname: Quality\non: [push, pull_request]\njobs:\n  test:\n    name: Test with Coverage\n    runs-on: ubuntu-latest\n    steps:\n    - name: Set up Go\n      uses: actions/setup-go@v2\n      with:\n        go-version: '1.16'\n    - name: Check out code\n      uses: actions/checkout@v2\n    - name: Install dependencies\n      run: |\n        go mod download\n    - name: Run Unit tests\n      run: |\n        go test -race -covermode atomic -coverprofile=covprofile ./...\n    - name: Install goveralls\n      run: go install github.com/mattn/goveralls@latest\n    - name: Send coverage\n      env:\n        COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      run: goveralls -coverprofile=covprofile -service=github\n    # or use shogo82148/actions-goveralls\n    # - name: Send coverage\n    #   uses: shogo82148/actions-goveralls@v1\n    #   with:\n    #     path-to-profile: covprofile\n```\n\n## Travis CI\n\n### GitHub Integration\n\nEnable Travis-CI on your GitHub repository settings.\n\nFor a **public** GitHub repository put bellow's `.travis.yml`.\n\n```yml\nlanguage: go\ngo:\n  - tip\nbefore_install:\n  - go install github.com/mattn/goveralls@latest\nscript:\n  - $GOPATH/bin/goveralls -service=travis-ci\n```\n\nFor a **public** GitHub repository, it is not necessary to define your repository key (`COVERALLS_TOKEN`).\n\nFor a **private** GitHub repository put bellow's `.travis.yml`. If you use **travis pro**, you need to specify `-service=travis-pro` instead of `-service=travis-ci`.\n\n```yml\nlanguage: go\ngo:\n  - tip\nbefore_install:\n  - go install github.com/mattn/goveralls@latest\nscript:\n  - $GOPATH/bin/goveralls -service=travis-pro\n```\n\nStore your Coveralls API token in `Environment variables`.\n\n```\nCOVERALLS_TOKEN = your_token_goes_here\n```\n\nor you can store token using [travis encryption keys](https://docs.travis-ci.com/user/encryption-keys/). Note that this is the token provided in the page for that specific repository on Coveralls. This is *not* one that was created from the \"Personal API Tokens\" area under your Coveralls account settings.\n\n```\n$ gem install travis\n$ travis encrypt COVERALLS_TOKEN=your_token_goes_here --add env.global\n```\n\ntravis will add `env` block as following example:\n\n```yml\nenv:\n  global:\n    secure: xxxxxxxxxxxxx\n```\n\n### For others:\n\n```\n$ go install github.com/mattn/goveralls@latest\n$ go test -covermode=count -coverprofile=profile.cov\n$ goveralls -coverprofile=profile.cov -service=travis-ci\n```\n\n## Drone.io\n\nStore your Coveralls API token in `Environment Variables`:\n\n```\nCOVERALLS_TOKEN=your_token_goes_here\n```\n\nReplace the `go test` line in your `Commands` with these lines:\n\n```\n$ go install github.com/mattn/goveralls@latest\n$ goveralls -service drone.io\n```\n\n`goveralls` automatically use the environment variable `COVERALLS_TOKEN` as the\ndefault value for `-repotoken`.\n\nYou can use the `-v` flag to see verbose output from the test suite:\n\n```\n$ goveralls -v -service drone.io\n```\n\n## CircleCI\n\nStore your Coveralls API token as an [Environment Variable](https://circleci.com/docs/environment-variables).\n\nIn your `circle.yml` add the following commands under the `test` section.\n\n```yml\ntest:\n  pre:\n    - go install github.com/mattn/goveralls@latest\n  override:\n    - go test -v -cover -race -coverprofile=/home/ubuntu/coverage.out\n  post:\n    - /home/ubuntu/.go_workspace/bin/goveralls -coverprofile=/home/ubuntu/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN\n```\n\nFor more information, See https://docs.coveralls.io/go\n\n## Semaphore\n\nStore your Coveralls API token in `Environment Variables`:\n\n```\nCOVERALLS_TOKEN=your_token_goes_here\n```\n\nMore instructions on how to do this can be found in the [Semaphore documentation](https://semaphoreci.com/docs/exporting-environment-variables.html).\n\nReplace the `go test` line in your `Commands` with these lines:\n\n```\n$ go install github.com/mattn/goveralls@latest\n$ goveralls -service semaphore\n```\n\n`goveralls` automatically use the environment variable `COVERALLS_TOKEN` as the\ndefault value for `-repotoken`.\n\nYou can use the `-v` flag to see verbose output from the test suite:\n\n```\n$ goveralls -v -service semaphore\n```\n\n## Jenkins CI\n\nAdd your Coveralls API token as a credential in Jenkins (see [Jenkins documentation](https://www.jenkins.io/doc/book/using/using-credentials/#configuring-credentials)).\n\nThen declare it as the environment variable `COVERALLS_TOKEN`:\n```groovy\npipeline {\n    agent any\n    stages {\n        stage('Test with coverage') {\n            steps {\n                sh 'go test ./... -coverprofile=coverage.txt -covermode=atomic'\n            }\n        }\n        stage('Upload to coveralls.io') {\n            environment {\n                COVERALLS_TOKEN     = credentials('coveralls-token')\n            }\n            steps {\n                sh 'goveralls -coverprofile=coverage.txt'\n            }\n        }\n    }\n}\n```\n\nSee also [related Jenkins documentation](https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#for-secret-text-usernames-and-passwords-and-secret-files).\n\nIt is also possible to let goveralls run the code coverage on its own without providing a coverage profile file.\n\n## TeamCity\n\nStore your Coveralls API token in `Environment Variables`:\n\n```\nCOVERALLS_TOKEN=your_token_goes_here\n```\n\nSetup build steps:\n\n```\n$ go install github.com/mattn/goveralls@latest\n$ export PULL_REQUEST_NUMBER=%teamcity.build.branch%\n$ goveralls -service teamcity -jobid %teamcity.build.id% -jobnumber %build.number%\n```\n\n`goveralls` will automatically use the environment variable `COVERALLS_TOKEN` as the\ndefault value for `-repotoken`.\n\nYou can use the `-v` flag to see verbose output.\n\n\n## Gitlab CI\n\nStore your Coveralls API token as an [Environment Variable](https://docs.gitlab.com/ee/ci/variables/#create-a-custom-variable-in-the-ui) named `COVERALLS_TOKEN`.\n\n```yml\ntest:\n  timeout: 30m\n  stage: test\n  artifacts:\n    paths:\n      - coverage.txt\n  dependencies:\n    - build:env\n  when: always\n  script:\n    - go test -covermode atomic -coverprofile=coverage.txt ./...\n    - go install github.com/mattn/goveralls@latest\n    - goveralls -service=gitlab -coverprofile=coverage.txt\n```\n\n## Coveralls Enterprise\n\nIf you are using Coveralls Enterprise and have a self-signed certificate, you need to skip certificate verification:\n\n```shell\n$ goveralls -insecure\n```\n\n# Authors\n\n* Yasuhiro Matsumoto (a.k.a. mattn)\n* haya14busa\n\n# License\n\nunder the MIT License: http://mattn.mit-license.org/2016\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattn%2Fgoveralls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattn%2Fgoveralls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattn%2Fgoveralls/lists"}