Skip to content

Commit

Permalink
Update gcov2lcov to 1.0.2 (#3)
Browse files Browse the repository at this point in the history
bump to gcov2lcov 1.0.1
fix integration test
  • Loading branch information
jandelgado committed Apr 26, 2020
1 parent 8def362 commit 4a15242
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 12 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ jobs:
uses: actions/checkout@v1
- name: Integration test
run: |
# build image and run container with integration test case of
# original gcov2lcov repository.
# perform an integration test with original gcov2lcov integration
# test data, which is available in the testdata/ directory.
docker build -t gcov2lcov-action .
git clone https://github.com/jandelgado/gcov2lcov.git
# create bare-bones go project to run the action on
mkdir -p gcov2lcov/.git
echo -e '[remote "origin"]\nurl = git@github.com:jandelgado/gcov2lcov\n' > gcov2lcov/.git/config
echo -e "package main\n" > gcov2lcov/main.go
echo -e "module github.com/jandelgado/gcov2lcov\ngo 1.12\n" > gcov2lcov/go.mod
cp testdata/coverage.out gcov2lcov/
docker run -e "GITHUB_WORKSPACE=/test" \
-e "INPUT_INFILE=testdata/coverage.out" \
-e "INPUT_OUTFILE=testdata/coverage.lcov" \
-e "INPUT_INFILE=coverage.out" \
-e "INPUT_OUTFILE=coverage.lcov" \
-i --rm -v "$PWD/gcov2lcov:/test" gcov2lcov-action
diff gcov2lcov/testdata/coverage_expected.lcov gcov2lcov/testdata/coverage.lcov
diff testdata/coverage_expected.lcov gcov2lcov/coverage.lcov
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# changelog for gcov2lcov-action

## 1.0.2 [2020-04-25]

* bump to gcov2lcov 1.0.2 to address coverage calculation problem
(https://github.com/jandelgado/gcov2lcov-action/issues/2)

## 1.0.0 [2019-10-07]

* initial release
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LABEL "com.github.actions.color"="blue"
WORKDIR /go/src/app
ADD . /go/src/app

RUN GO111MODULE=on go get -u github.com/jandelgado/gcov2lcov
RUN GO111MODULE=on go get -u github.com/jandelgado/gcov2lcov@v1.0.2

COPY entrypoint.sh /

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ No outputs.
## Example usage

```yaml
uses: jandelgado/gcov2lcov-action@v1.0.0
uses: jandelgado/gcov2lcov-action@v1.0.1
with:
infile: coverage.out
outfile: coverage.lcov
Expand All @@ -47,7 +47,7 @@ with:
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.0
uses: jandelgado/gcov2lcov-action@v1.0.1
with:
infile: coverage.out
outfile: coverage.lcov
Expand All @@ -60,7 +60,6 @@ with:

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


## Author

Copyright (C) 2019 Jan Delgado
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: 'gcov2lcov-action'
description: 'convert golang coverage to lcov format'
inputs:
infile:
infile:
description: 'go coverage input file'
required: true
default: 'coverage.out'
outfile:
outfile:
description: 'lcov output file'
required: true
default: 'coverage.lcov'
Expand Down
4 changes: 4 additions & 0 deletions testdata/coverage.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mode: set
github.com/jandelgado/gcov2lcov/main.go:45.44,49.38 4 1
github.com/jandelgado/gcov2lcov/main.go:46.44,50.38 4 0
github.com/jandelgado/gcov2lcov/main.go:58.2,58.32 1 1
12 changes: 12 additions & 0 deletions testdata/coverage_expected.lcov
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
TN:
SF:main.go
DA:45,1
DA:46,1
DA:47,1
DA:48,1
DA:49,1
DA:50,0
DA:58,1
LF:7
LH:6
end_of_record

0 comments on commit 4a15242

Please sign in to comment.