From 02e1fb75243be3fa6be8b451eedbb1dd46fe2ca8 Mon Sep 17 00:00:00 2001 From: Juncheng Zhu Date: Tue, 26 Jul 2022 16:25:44 +0800 Subject: [PATCH 1/3] Migrate to codecov.io Signed-off-by: Juncheng Zhu --- .github/.codecov.yml | 5 +++++ .github/workflows/reusable-build.yml | 7 ++----- .gitignore | 3 +-- Makefile | 2 +- README.md | 3 +++ scripts/test.sh | 19 ------------------- 6 files changed, 12 insertions(+), 27 deletions(-) create mode 100644 .github/.codecov.yml delete mode 100755 scripts/test.sh diff --git a/.github/.codecov.yml b/.github/.codecov.yml new file mode 100644 index 00000000..0b3e2618 --- /dev/null +++ b/.github/.codecov.yml @@ -0,0 +1,5 @@ +coverage: + status: + project: + default: + target: 89% \ No newline at end of file diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 9e28463c..5facb6f1 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -20,8 +20,5 @@ jobs: check-latest: true - name: Run unit tests run: make test - - name: Upload coverage report - uses: actions/upload-artifact@master - with: - name: notation-coverage-report-${{ github.sha }} - path: .cover/ \ No newline at end of file + - name: Upload coverage to codecov.io + uses: codecov/codecov-action@v3 \ No newline at end of file diff --git a/.gitignore b/.gitignore index f8ef0940..53dc08f4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ .vscode # Custom -.cover/ -.test/ \ No newline at end of file +coverage.txt \ No newline at end of file diff --git a/Makefile b/Makefile index a85376e5..240723a7 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ all: test .PHONY: test test: check-line-endings ## run unit tests - ./scripts/test.sh + go test -race -v -coverprofile=coverage.txt -covermode=atomic ./... .PHONY: clean clean: diff --git a/README.md b/README.md index ffbd94cb..157eb064 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # notation-core-go + +[![codecov](https://codecov.io/gh/notatryproject/notation-core-go/branch/main/graph/badge.svg)](https://codecov.io/gh/notatryproject/notation-core-go) + Contains support for Notary v2 signature envelope, and format specific implementation diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index 91431f18..00000000 --- a/scripts/test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -ex - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd $DIR/../ - -rm -rf .cover/ .test/ -mkdir .cover/ .test/ -trap "rm -rf .test/" EXIT - -export CGO_ENABLED=0 -for pkg in `go list ./...`; do - go test -v -covermode=atomic \ - -coverprofile=".cover/$(echo $pkg | sed 's/\//_/g').cover.out" $pkg -done - -echo "mode: set" > .cover/cover.out && cat .cover/*.cover.out | grep -v mode: | sort -r | \ - awk '{if($1 != last) {print $0;last=$1}}' >> .cover/cover.out - -go tool cover -html=.cover/cover.out -o=.cover/coverage.html From d1227cfe3a7569d8f2fb80cbfc48214f84a28cd5 Mon Sep 17 00:00:00 2001 From: Juncheng Zhu Date: Tue, 26 Jul 2022 23:22:24 +0800 Subject: [PATCH 2/3] fix. remove extra space Signed-off-by: Juncheng Zhu --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 240723a7..0afb6a6d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ all: test .PHONY: test test: check-line-endings ## run unit tests - go test -race -v -coverprofile=coverage.txt -covermode=atomic ./... + go test -race -v -coverprofile=coverage.txt -covermode=atomic ./... .PHONY: clean clean: From 54f2ddbc142e1e49254b71ef577b0b951aa07ab2 Mon Sep 17 00:00:00 2001 From: Juncheng Zhu Date: Thu, 28 Jul 2022 10:01:30 +0800 Subject: [PATCH 3/3] Doc. update README Signed-off-by: Juncheng Zhu --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 157eb064..2f1ca888 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # notation-core-go -[![codecov](https://codecov.io/gh/notatryproject/notation-core-go/branch/main/graph/badge.svg)](https://codecov.io/gh/notatryproject/notation-core-go) +[![codecov](https://codecov.io/gh/notaryproject/notation-core-go/branch/main/graph/badge.svg)](https://codecov.io/gh/notaryproject/notation-core-go) Contains support for Notary v2 signature envelope, and format specific implementation