From 5d0c832f152f4add9ebbb18a691ed6890bc9fa95 Mon Sep 17 00:00:00 2001 From: "ondrej.benkovsky" Date: Tue, 26 Nov 2024 21:06:25 +0100 Subject: [PATCH] coverage rework --- .circleci/config.yml | 5 ++++- .github/workflows/go.coverage.yml | 26 -------------------------- 2 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/go.coverage.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index f180c86..5c63d2a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,7 @@ # Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 +orbs: + codecov: codecov/codecov@5 jobs: build: working_directory: ~/repo @@ -21,7 +23,8 @@ jobs: name: Run tests command: | mkdir -p /tmp/test-reports - gotestsum --junitfile /tmp/test-reports/unit-tests.xml -- -json -race ./... + gotestsum --junitfile /tmp/test-reports/unit-tests.xml -- -json -race -coverprofile=coverage.txt -covermode=atomic ./... + - codecov/upload - store_artifacts: path: /tmp/test-reports - store_test_results: diff --git a/.github/workflows/go.coverage.yml b/.github/workflows/go.coverage.yml deleted file mode 100644 index acfe791..0000000 --- a/.github/workflows/go.coverage.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Go Coverage -on: - pull_request: - push: - branches: - - master -jobs: - test: - name: Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - - name: Build - run: go build -v ./... - - name: Test With Coverage - run: | - go test -coverprofile=cover.out -covermode=atomic -race ./...; [ -f cover.out ] && cat cover.out >> ../coverage.txt - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}