Generate a test coverage badge like this one for your go projects.

Overview

coverage-badge-go

CI Coverage Update release version. Public workflows that use this action. Ubuntu Mac OS Windows

              👆

Generate a test coverage badge like this one for your go projects.

Usage

on:
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    name: Update coverage badge
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
          fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
      
      - name: Setup go
        uses: actions/setup-go@v2
        with:
          go-version: '1.14.4'

      - uses: actions/cache@v2
        with:
          path: ~/go/pkg/mod
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-

      - name: Run Test  # Pass the `coverage.out` output to this action
        run:
          go test -v ./... -covermode=count -coverprofile=coverage.out
          go tool cover -func=coverage.out -o=coverage.out

      - name: Go Coverage Badge
        uses: tj-actions/coverage-badge-go@v1
        with:
          filename: coverage.out

      - name: Verify Changed files
        uses: tj-actions/[email protected]
        id: verify-changed-files
        with:
          files: README.md

      - name: Push changes
        if: steps.changed_files.outputs.files_changed == 'true'
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ github.token }}
          branch: ${{ github.head_ref }}

Features

  • Generate coverage badge from a coverage report.

Inputs

Input type required default description
filename string true coverage.out File containing the
tests output
(default: "coverage.out")

If you feel generous and want to show some extra appreciation:

Buy me a coffee

Credits

This package was created with Cookiecutter using cookiecutter-action

Report Bugs

Report bugs at https://github.com/tj-actions/coverage-badge-go/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.
Comments
Releases(v2.1)
  • v2.1(Oct 8, 2022)

    What's Changed

    • Upgraded to v2 by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/66
    • Update tj-actions/auto-doc action to v1.4.0 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/67
    • Update tj-actions/auto-doc action to v1.4.1 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/68
    • Update tj-actions/verify-changed-files action to v11 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/69
    • Update tj-actions/verify-changed-files action to v11 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/70
    • Update tj-actions/github-changelog-generator action to v1.15 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/71
    • Update tj-actions/sync-release-version action to v12 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/72
    • Update codacy/codacy-analysis-cli-action action to v4.2.0 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/73
    • Update peter-evans/create-pull-request action to v4.1.2 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/74
    • Update peter-evans/create-pull-request action to v4.1.3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/76

    Full Changelog: https://github.com/tj-actions/coverage-badge-go/compare/v2...v2.1

    Source code(tar.gz)
    Source code(zip)
  • v2(Aug 18, 2022)

    Changes in v2.1

    What's Changed

    • Upgraded to v2 by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/66
    • Update tj-actions/auto-doc action to v1.4.0 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/67
    • Update tj-actions/auto-doc action to v1.4.1 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/68
    • Update tj-actions/verify-changed-files action to v11 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/69
    • Update tj-actions/verify-changed-files action to v11 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/70
    • Update tj-actions/github-changelog-generator action to v1.15 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/71
    • Update tj-actions/sync-release-version action to v12 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/72
    • Update codacy/codacy-analysis-cli-action action to v4.2.0 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/73
    • Update peter-evans/create-pull-request action to v4.1.2 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/74
    • Update peter-evans/create-pull-request action to v4.1.3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/76

    Full Changelog: https://github.com/tj-actions/coverage-badge-go/compare/v2...v2.1


    Source code(tar.gz)
    Source code(zip)
  • v1.2(May 19, 2022)

    What's Changed

    • Upgraded to v1.1 by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/33
    • Updated README.md by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/34
    • Updated README.md by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/35
    • Update tj-actions/auto-doc action to v1.2.11 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/36
    • Updated README.md by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/37
    • Update tj-actions/auto-doc action to v1.2.13 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/38
    • chore: fix usage of incorrect action id by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/40
    • Update tj-actions/sync-release-version action to v11 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/41
    • Update tj-actions/github-changelog-generator action to v1.12 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/42
    • Update actions/setup-go action to v3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/43
    • Update actions/checkout action to v3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/44
    • Update tj-actions/verify-changed-files action to v9 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/47
    • Update tj-actions/github-changelog-generator action to v1.13 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/48
    • Update tj-actions/auto-doc action to v1.2.14 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/49
    • Update actions/cache action to v3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/50
    • Update peter-evans/create-pull-request action to v4 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/51
    • Update pascalgn/automerge-action action to v0.15.2 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/52
    • Update cirrus-actions/rebase action to v1.6 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/53
    • Update cirrus-actions/rebase action to v1.7 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/54
    • Update pascalgn/automerge-action action to v0.15.3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/55

    Full Changelog: https://github.com/tj-actions/coverage-badge-go/compare/v1.1...v1.2

    Source code(tar.gz)
    Source code(zip)
  • v1.1(Jan 23, 2022)

    What's Changed

    • Upgraded to v1 by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/16
    • Add support for all platforms by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/17
    • Update tj-actions/verify-changed-files action to v8.2 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/19
    • Update tj-actions/verify-changed-files action to v8.3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/21
    • Update actions/checkout action to v2.4.0 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/22
    • Updated README.md by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/23
    • Update tj-actions/verify-changed-files action to v8.6 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/24
    • Update tj-actions/verify-changed-files action to v8.7 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/25
    • Update tj-actions/verify-changed-files action to v8.8 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/26
    • Update tj-actions/github-changelog-generator action to v1.10 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/27
    • Update tj-actions/github-changelog-generator action to v1.11 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/28
    • Update tj-actions/remark action to v2 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/29
    • Update tj-actions/remark action to v2.2 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/30
    • Update tj-actions/remark action to v2.3 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/31
    • Remove unused outputs by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/32

    Full Changelog: https://github.com/tj-actions/coverage-badge-go/compare/v1...v1.1

    Source code(tar.gz)
    Source code(zip)
  • v1(Oct 16, 2021)

    What's Changed

    • Updated README.md by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/7
    • Update tj-actions/verify-changed-files action to v8 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/5
    • Update tj-actions/remark action to v1.7 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/4
    • Update tj-actions/github-changelog-generator action to v1.8 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/3
    • Update cirrus-actions/rebase action to v1.5 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/2
    • Update actions/checkout action to v2.3.5 by @renovate in https://github.com/tj-actions/coverage-badge-go/pull/1
    • Upgraded to v1 by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/9
    • Updated README.md by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/11
    • chore: updated coverage Badge by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/10
    • Updated README.md by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/12
    • chore: updated coverage badge by @jackton1 in https://github.com/tj-actions/coverage-badge-go/pull/14

    New Contributors

    • @jackton1 made their first contribution in https://github.com/tj-actions/coverage-badge-go/pull/7
    • @renovate made their first contribution in https://github.com/tj-actions/coverage-badge-go/pull/5

    Full Changelog: https://github.com/tj-actions/coverage-badge-go/commits/v1

    Source code(tar.gz)
    Source code(zip)
Owner
tj-actions
tj-actions
Test coverage in Go, the whole package

Test coverage in Go, the whole package

Eleni Fragkiadaki 5 Jan 20, 2022
go-test-trace is like go test but it also generates distributed traces.

go-test-trace go-test-trace is like go test but it also generates distributed traces. Generated traces are exported in OTLP to a OpenTelemetry collect

JBD 376 Jan 5, 2023
Automatically generate Go test boilerplate from your source code.

gotests gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' functi

Charles Weill 4.4k Jan 8, 2023
The portal gates to coverage reports

Covergates - Portal Gates to Coverage Reports Purpose Covergates is to make the easiest way to setup a self-hosted coverage report service. It's an al

Covergates 55 Dec 18, 2022
A Comprehensive Coverage Testing System for The Go Programming Language

goc 中文页 | goc is a comprehensive coverage testing system for The Go Programming Language, especially for some complex scenarios, like system testing c

Qiniu Cloud 613 Jan 8, 2023
Coverage testing tool for The Go Programming Language

gocov Coverage reporting tool for The Go Programming Language Installation go get github.com/axw/gocov/gocov Usage There are currently four gocov comm

Andrew Wilkins 790 Jan 3, 2023
Hsuan-Fuzz: REST API Fuzzing by Coverage Level Guided Blackbox Testing

Hsuan-Fuzz: REST API Fuzzing by Coverage Level Guided Blackbox Testing Architecture Usage package main import ( restAPI "github.com/iasthc/hsuan-

Chung-Hsuan Tsai 20 Nov 30, 2022
This is a simple test application that sends fake video data from one pion instance to another

Pion test app for BWE This is a simple test application that sends fake video data from one pion instance to another. It is a modified version of the

Mathis Engelbart 2 Jun 8, 2022
An assert function for Go that works like the one in C.

Assert This package provides an assert function for Go. It's designed to work like assert in C.

Josh 20 Nov 16, 2022
Flugel Test Documentation for steps to run and test the automatio

Flugel Test Documentation Documentation for steps to run and test the automation #Test-01 1 - Local Test Using Terratest (End To End) 1- By runing " t

Suc0_Unix 0 Nov 13, 2022
Test-assignment - Test assignment with golang

test-assignment We have a two steam of data and we need to save it in the map: I

null 0 Jan 19, 2022
This repository includes consumer driven contract test for provider, unit test and counter api.

This repository includes consumer driven contract test for provider, unit test and counter api.

Ahmet Zümberoğlu 0 Feb 1, 2022
Ruby on Rails like test fixtures for Go. Write tests against a real database

testfixtures Warning: this package will wipe the database data before loading the fixtures! It is supposed to be used on a test database. Please, doub

null 895 Jan 8, 2023
Test your command line interfaces on windows, linux and osx and nodes viá ssh and docker

Commander Define language independent tests for your command line scripts and programs in simple yaml files. It runs on windows, osx and linux It can

null 209 Dec 17, 2022
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻

Gnomock – tests without mocks ??️ Spin up entire dependency stack ?? Setup initial dependency state – easily! ?? Test against actual, close to product

Yury Fedorov 1k Dec 29, 2022
Cloud Spanner load generator to load test your application and pre-warm the database before launch

GCSB GCSB Quickstart Create a test table Load data into table Run a load test Operations Load Single table load Multiple table load Loading into inter

Cloud Spanner Ecosystem 22 Nov 30, 2022
Small program that takes in commands and moves one or more robots around the surface of Mars!

Mars Rover Build and Run the Image Build image from current directory: docker build -t marsrover . Run image interactively: docker run -i marsrover

Karl King 0 Jan 2, 2022
Wise-mars-rover - Write a program that takes in commands and moves one or more robots around the surface of Mars

wise-mars-rover Write a program that takes in commands and moves one or more rob

Daniel Churm 0 Feb 9, 2022
Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test

embedded-postgres Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test. When testing this provides

Fergus Strange 494 Dec 27, 2022