diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5f86d25..ed8df90 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,4 +21,26 @@ jobs: run: go build -v ./... - name: Test - run: go test -v ./... + run: go test -v -tags skip ./... + + coverage: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Checkout code + uses: actions/checkout@v2 + - name: Calc coverage + run: go test -v -covermode=count -coverprofile=coverage.out -tags skip ./... + - name: Convert coverage to lcov + uses: jandelgado/gcov2lcov-action@v1.0.8 + with: + infile: coverage.out # optional, default filename is `coverage.out` + outfile: coverage.lcov # optional, default filename is `coverage.lcov` + - name: Coveralls + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage.lcov \ No newline at end of file diff --git a/Jet.go b/Jet.go index 10260c9..e5ed450 100644 --- a/Jet.go +++ b/Jet.go @@ -1,3 +1,5 @@ +// +build !skip + package main import ( diff --git a/Jet_test.go b/Jet_test.go new file mode 100644 index 0000000..12460e3 --- /dev/null +++ b/Jet_test.go @@ -0,0 +1,10 @@ +package main + +import "testing" + +/** +This file is only attempted to help code coverage calculation. + */ +func TestMain(m *testing.M) { + +} \ No newline at end of file diff --git a/README.md b/README.md index ee2b761..ccbd8da 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Jet [![Go](https://github.com/go-gems/Jet/actions/workflows/go.yml/badge.svg)](https://github.com/go-gems/Jet/actions/workflows/go.yml) +[![Coverage Status](https://coveralls.io/repos/github/go-gems/Jet/badge.svg?branch=master)](https://coveralls.io/github/go-gems/Jet?branch=master) To launch :