From 0a02826f637466ca611d41865aed5e4f74af630d Mon Sep 17 00:00:00 2001 From: Tolga Ozen <39353278+tolgaOzen@users.noreply.github.com> Date: Sun, 17 Sep 2023 03:23:43 +0300 Subject: [PATCH] Update coverage.yml --- .github/workflows/coverage.yml | 35 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 38db2a201..ee7345a49 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,26 +1,25 @@ -name: Go Test and Coveralls -on: - push: - branches: - - master +name: Quality +on: [push, pull_request] jobs: - build: + test: + name: Test with Coverage runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v2 with: - go-version: ~1.20.2 - - - name: Install Coveralls - run: go get github.com/mattn/goveralls - - - name: Run Tests and Upload Coverage + go-version: '1.20' + - name: Check out code + uses: actions/checkout@v2 + - name: Install dependencies run: | - go test -v -coverprofile=profile.cov ./cmd/... ./internal/... ./pkg/... + go mod download + - name: Run Unit tests + run: | + go test -race -covermode atomic -coverprofile=covprofile ./cmd/... ./internal/... ./pkg/... + - name: Install goveralls + run: go install github.com/mattn/goveralls@latest + - name: Send coverage env: COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + run: goveralls -coverprofile=covprofile -service=github