diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index db65d8fd7..59e047ed0 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -35,14 +35,37 @@ jobs: - name: Checkout Git Repository uses: actions/checkout@v3 - - name: Unit Tests with Code Coverage + - name: Run Go Tests + run: make test + + - name: Check format run: | - make test + if [[ $(go fmt `go list ./... | grep -v vendor`) ]]; then + echo "not well formatted sources are found" + exit 1 + fi - - name: Upload Code Coverage Report - uses: codecov/codecov-action@v3 + - name: Generate coverage report + run: | + go test `go list ./... | grep -v examples` -coverprofile=coverage.txt -covermode=atomic + + - name: Upload coverage report + uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt + flags: unittests + name: codecov-umbrella + + - name: Get code coverage artifiact + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: code-coverage + - name: Get test result artifact + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: test-results + path: test-results + - name: Upload code coverage information to codecov.io + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 with: - token: ${{ secrets.CODECOV_TOKEN }} - file: cover.out - verbose: true - fail_ci_if_error: true + file: coverage.out