Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jandelgado/gcov2lcov-action

Github action to convert go coverage files to lcov format
https://github.com/jandelgado/gcov2lcov-action

coverage coverage-files gcov2lcov gcov2lcov-action golang lcov testing

Last synced: 8 days ago
JSON representation

Github action to convert go coverage files to lcov format

Awesome Lists containing this project

README

        

# gcov2lcov-action

[![Build Status](https://github.com/jandelgado/gcov2lcov-action/workflows/test/badge.svg)](https://github.com/jandelgado/gcov2lcov-action/actions?workflow=test)

NOTE



The coverallsapp-action
now supports the golang coverage format out of the box. You probably won't need
this action anymore. Example:

```yaml
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
file: coverage.out
format: golang
```

## What

Convert golang coverage files to lcov format. Works nicely with the [coveralls
github action](https://github.com/marketplace/actions/coveralls-github-action) and
uses [gcov2lcov](https://github.com/jandelgado/gcov2lcov) under the hood.

## Inputs

### `infile`

**Optional** Name of the go coverage file. Default `coverage.out`.

### `outfile`

**Optional** Name of the lcov file to write. Default `coverage.lcov`.

### `version`

**Optional** Name of the specific gcov2lcov program version. Default `latest`.

### `working-directory`

**Optional** Name of directory where gcov2lcov is run. Defaults to `$GITHUB_WORKSPACE`.

## Outputs

No outputs.

## Example usage

```yaml
uses: jandelgado/gcov2lcov-action@v1
with:
infile: coverage.out # optional, default filename is `coverage.out`
outfile: coverage.lcov # optional, default filename is `coverage.lcov`
version: v1.0.4 # optional, use specific `gcov2lcov` release version
working-directory: testdata # optional, change working directory
```

### Full example

```yaml
coverage:
runs-on: ubuntu-latest
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Checkout code
uses: actions/checkout@v2
- name: Calc coverage
run: go test -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
```

See also [example repository](https://github.com/jandelgado/golang-ci-template-github-actions).

## Author

Copyright © 2019 - 2022 Jan Delgado

## License

[MIT](LICENSE)