-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redesign action working mode: no longer use docker image
- Loading branch information
Showing
8 changed files
with
90 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
on: [push, pull_request] | ||
name: test | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
if: success() | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.15.x | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Integration test | ||
run: | | ||
# perform an integration test with original gcov2lcov integration | ||
# test data, which is available in the testdata/ directory. | ||
docker build -t gcov2lcov-action . | ||
# 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.15\n" > gcov2lcov/go.mod | ||
cp testdata/coverage.out gcov2lcov/ | ||
docker run -e "GITHUB_WORKSPACE=/test" \ | ||
-e "INPUT_INFILE=coverage.out" \ | ||
-e "INPUT_OUTFILE=coverage.lcov" \ | ||
-i --rm -v "$PWD/gcov2lcov:/test" gcov2lcov-action | ||
diff -y testdata/coverage_expected.lcov gcov2lcov/coverage.lcov | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Prepare | ||
run: git init | ||
working-directory: testdata | ||
- name: Run gcov2lcov-action | ||
uses: ./ | ||
with: | ||
workspace: testdata | ||
- name: Diff | ||
run: diff -y coverage_expected.lcov coverage.lcov | ||
working-directory: testdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
# changelog for gcov2lcov-action | ||
# Changelog for gcov2lcov-action | ||
|
||
## 1.0.5 [2020-10-15] | ||
|
||
- without docker runtime | ||
|
||
## 1.0.4 [2020-10-13] | ||
|
||
- bump to gcov2lcov 1.0.4 | ||
- use precompiled binary | ||
|
||
## 1.0.3 [2020-09-11] | ||
|
||
* bump to gcov2lcov 1.0.3 | ||
- bump to gcov2lcov 1.0.3 | ||
|
||
## 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) | ||
- 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 | ||
- initial release |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
name: 'gcov2lcov-action' | ||
description: 'convert golang coverage to lcov format' | ||
name: gcov2lcov-action | ||
|
||
description: "convert golang coverage to lcov format" | ||
|
||
inputs: | ||
infile: | ||
description: 'go coverage input file' | ||
description: "go coverage input file" | ||
required: true | ||
default: 'coverage.out' | ||
default: coverage.out | ||
outfile: | ||
description: 'lcov output file' | ||
description: "lcov output file" | ||
required: true | ||
default: 'coverage.lcov' | ||
default: coverage.lcov | ||
version: | ||
description: "gcov2lcov version" | ||
required: true | ||
default: v1.0.4 | ||
workspace: | ||
description: "working directory" | ||
required: false | ||
|
||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
using: composite | ||
steps: | ||
- name: Run gcov2lcov | ||
run: ${{ github.action_path }}/entrypoint.sh | ||
shell: bash | ||
env: | ||
INFILE: ${{ inputs.infile }} | ||
OUTFILE: ${{ inputs.outfile }} | ||
VERSION: ${{ inputs.version }} | ||
WORKSPACE: ${{ inputs.workspace }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/sh | ||
set -eu | ||
#!/bin/bash | ||
set -xeuo pipefail | ||
|
||
unset GOPATH | ||
export GOROOT=/usr/local/go | ||
|
||
cd $GITHUB_WORKSPACE | ||
exec /app/gcov2lcov-linux-amd64 -infile "$INPUT_INFILE" -outfile "$INPUT_OUTFILE" | ||
TMP_BIN=$(mktemp -d -t ci-XXXXXXXXXX) | ||
NAME="gcov2lcov-linux-amd64" | ||
wget "https://github.com/jandelgado/gcov2lcov/releases/download/${VERSION}/${NAME}.tar.gz" -q -O - | tar zxf - --strip 1 --directory "$TMP_BIN" | ||
chmod +x "$TMP_BIN/$NAME" | ||
cd "$GITHUB_WORKSPACE/$WORKSPACE" || exit 1 | ||
exec "$TMP_BIN/gcov2lcov-linux-amd64" -infile "${INFILE}" -outfile "${OUTFILE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/jandelgado/gcov2lcov | ||
|
||
go 1.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package main |