Skip to content

Commit f720ab2

Browse files
committed
use pre-compiled binary of gcov2lcov
1 parent 93974c2 commit f720ab2

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ jobs:
88
if: success()
99
uses: actions/setup-go@v1
1010
with:
11-
go-version: 1.13.x
11+
go-version: 1.15.x
1212
- name: Checkout code
1313
uses: actions/checkout@v1
1414
- name: Integration test
1515
run: |
16-
# perform an integration test with original gcov2lcov integration
16+
# perform an integration test with original gcov2lcov integration
1717
# test data, which is available in the testdata/ directory.
1818
docker build -t gcov2lcov-action .
1919
2020
# create bare-bones go project to run the action on
2121
mkdir -p gcov2lcov/.git
2222
echo -e '[remote "origin"]\nurl = [email protected]:jandelgado/gcov2lcov\n' > gcov2lcov/.git/config
2323
echo -e "package main\n" > gcov2lcov/main.go
24-
echo -e "module github.com/jandelgado/gcov2lcov\ngo 1.12\n" > gcov2lcov/go.mod
24+
echo -e "module github.com/jandelgado/gcov2lcov\ngo 1.15\n" > gcov2lcov/go.mod
2525
cp testdata/coverage.out gcov2lcov/
2626
2727
docker run -e "GITHUB_WORKSPACE=/test" \

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# note: gcov2lcov also needs a running go executable in the container, so we
22
# keep this as the base
3-
FROM golang:1.13-alpine
3+
FROM golang:1.15-alpine
4+
5+
ARG VERSION=v1.0.4
46

57
LABEL MAINTAINER="Jan Delgado <[email protected]>"
68
LABEL "com.github.actions.description"="convert golang coverager to lcov format"
79
LABEL "com.github.actions.name"="gcov2lcov-action"
810
LABEL "com.github.actions.color"="blue"
911

10-
WORKDIR /go/src/app
11-
ADD . /go/src/app
12+
WORKDIR /app
13+
ADD . /app
1214

13-
RUN GO111MODULE=on go get -u github.com/jandelgado/[email protected]
15+
ENV GOROOT=/usr/local/go
16+
RUN wget https://github.com/jandelgado/gcov2lcov/releases/download/${VERSION}/gcov2lcov-linux-amd64.tar.gz -q -O - |\
17+
tar xvzf - --strip 1\
18+
&& chmod 755 gcov2lcov-linux-amd64
1419

1520
COPY entrypoint.sh /
1621

entrypoint.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/sh
22
set -eu
33

4-
unset GOROOT
54
unset GOPATH
65

76
cd $GITHUB_WORKSPACE
8-
/go/bin/gcov2lcov -infile "$INPUT_INFILE" -outfile "$INPUT_OUTFILE"
7+
/app/gcov2lcov-linux-amd64 -infile "$INPUT_INFILE" -outfile "$INPUT_OUTFILE"

0 commit comments

Comments
 (0)