Skip to content

Github action to convert go coverage files to lcov format

License

Notifications You must be signed in to change notification settings

jandelgado/gcov2lcov-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcov2lcov-action

Build Status

Convert golang coverage files to lcov format. Works nicely with the coveralls github action and uses gcov2lcov under the hood.

Inputs

infile

Required Name of the go coverage file. Default coverage.out.

outfile

Required Name of the lcov file to write. Default coverage.lcov.

Outputs

No outputs.

Example usage

uses: jandelgado/gcov2lcov-action@v1.0.4
with:
  infile: coverage.out
  outfile: coverage.lcov

Full example

coverage:
  runs-on: ubuntu-latest
  steps:
    - name: Install Go
      if: success()
      uses: actions/setup-go@v2-beta
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Calc coverage
      run: |
        export PATH=$PATH:$(go env GOPATH)/bin
        go test -v -covermode=count -coverprofile=coverage.out
    - name: Convert coverage to lcov
      uses: jandelgado/gcov2lcov-action@v1.0.5
      with:
        infile: coverage.out
        outfile: coverage.lcov
    - name: Coveralls
      uses: coverallsapp/github-action@v1.0.4
      with:
        github-token: ${{ secrets.github_token }}
        path-to-lcov: coverage.lcov

See also example repository.

Author

Copyright © 2019 - 2020 Jan Delgado

License

MIT