diff --git a/.github/workflows/lint-test-build-publish.yml b/.github/workflows/lint-test-build-publish.yml index f78672b8..09347fa7 100644 --- a/.github/workflows/lint-test-build-publish.yml +++ b/.github/workflows/lint-test-build-publish.yml @@ -383,7 +383,7 @@ jobs: contents: read name: Test Go runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 25 needs: - lint-go - check-license @@ -412,6 +412,20 @@ jobs: - name: Run tests run: mage test:golang + - name: Copy all coverage reports to single directory + if: always() + run: | + mkdir -p coverage + find . -regex ".*coverprofile.*" -exec sh -c 'cp $1 coverage/$(echo $1 | sed "s/\//-/g" | cut -c 3-)' sh {} ';' + + - name: Upload coverage reports + if: always() + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: Code coverage reports + path: coverage + retention-days: 1 + build-containers: permissions: contents: read diff --git a/mage/test.go b/mage/test.go index 197d65de..7ee38e04 100644 --- a/mage/test.go +++ b/mage/test.go @@ -57,6 +57,11 @@ func (Test) golang() error { "--race", "-randomize-all", "-randomize-suites", + // "--fail-on-pending", + // "--fail-on-empty", + // "--keep-going", + "--cover", + // "-coverpkg="+strings.Join(skippedPackages, ","), "--skip-package="+strings.Join(skippedPackages, ","), ) }