From 88320875343e12f890e4d6238c3fab81fdd89e12 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 30 Sep 2022 07:56:01 +0200 Subject: [PATCH] ci: add coverage workflow --- .github/workflows/coverage.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..bcc6721 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,28 @@ +name: coverage +on: [push, pull_request] + +jobs: + coverage: + strategy: + matrix: + go-version: [^1] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + env: + GO111MODULE: "on" + steps: + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + go test -race -covermode atomic -coverprofile=profile.cov ./... + GO111MODULE=off go get github.com/mattn/goveralls + $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github