From 742f98fbebe759df3695293e46c0e271d903eb42 Mon Sep 17 00:00:00 2001 From: James Carnegie Date: Mon, 24 Jun 2024 14:26:07 +0100 Subject: [PATCH] Generate coverage when tests are run (#64) * Generate coverage when tests are run * Use docker's codecov account --- .github/workflows/test.yml | 10 +++++++++- README.md | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17a5ee3..4897367 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,4 +26,12 @@ jobs: with: token: ${{ secrets.TC_CLOUD_TOKEN }} - name: go test - run: go test ./... + run: go test -v ./... -coverprofile=coverage.out -covermode=atomic + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage.out + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 784059b..b1a49ac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # attest library to create, verify, and evaluate policy for attestations on container images +[![codecov](https://codecov.io/gh/docker/attest/graph/badge.svg?token=cGT0f1ACKg)](https://codecov.io/gh/docker/attest) + # usage ## signing and verifying attestations See [example_sign_test.go](./pkg/attest/example_sign_test.go)