From f1e631136643c36ef37273b5e4c1c7de7fa91f4b Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 31 May 2020 11:55:46 +0100 Subject: [PATCH] Add coverage data to github action --- .github/workflows/docker-image.yml | 6 ++++++ script/test.sh | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d9c7e9c..fc20efb 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -32,3 +32,9 @@ jobs: - name: Build and Test run: ./script/test.sh + + - name: Upload test coverage result + uses: actions/upload-artifact@v1 + with: + name: Coverage + path: /tmp/coverage.html diff --git a/script/test.sh b/script/test.sh index ce26225..2f8d90b 100755 --- a/script/test.sh +++ b/script/test.sh @@ -15,5 +15,8 @@ docker build . # Run the integration tests with docker-compose docker-compose up --build --detach -go test -v ./... -tags integration -cover -docker-compose down \ No newline at end of file +go test -v ./... -tags integration -cover -coverprofile=/tmp/c.out +docker-compose down + +# Convert the coverage data to html +go tool cover -html=/tmp/c.out -o /tmp/coverage.html \ No newline at end of file