From 99fc5fe2c9ef7c9ed8ee02072737b813b62fdfeb Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Thu, 24 Oct 2024 08:32:42 +0800 Subject: [PATCH] ci: enable code coverage --- .github/workflows/ci.yml | 11 +++++++++-- README-CN.md | 1 + README.md | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6543bed..abc0aed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,14 @@ jobs: go-version: ${{ matrix.goVer }} - name: Test - run: go test ./... + run: go test -coverprofile=coverage1.txt ./... - name: Test Generic - run: go test -tags purego ./... + run: go test -tags purego -coverprofile=coverage2.txt ./... + + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./coverage1.txt,./coverage2.txt + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README-CN.md b/README-CN.md index dba005b..a8bc000 100644 --- a/README-CN.md +++ b/README-CN.md @@ -7,6 +7,7 @@ [![arm64](/~https://github.com/emmansun/base64/actions/workflows/arm64_qemu.yml/badge.svg)](/~https://github.com/emmansun/base64/actions/workflows/arm64_qemu.yml) [![ppc64le](/~https://github.com/emmansun/base64/actions/workflows/ppc64le_qemu.yml/badge.svg)](/~https://github.com/emmansun/base64/actions/workflows/ppc64le_qemu.yml) [![s390x](/~https://github.com/emmansun/base64/actions/workflows/s390x_qemu.yml/badge.svg)](/~https://github.com/emmansun/base64/actions/workflows/s390x_qemu.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/emmansun/base64)](https://goreportcard.com/report/github.com/emmansun/base64) [![Documentation](https://godoc.org/github.com/emmansun/base64?status.svg)](https://godoc.org/github.com/emmansun/base64) ![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/emmansun/base64) [![Release](https://img.shields.io/github/release/emmansun/base64/all.svg)](/~https://github.com/emmansun/base64/releases) diff --git a/README.md b/README.md index 5137b67..b7a62bc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Base64 with SIMD acceleration [![arm64](/~https://github.com/emmansun/base64/actions/workflows/arm64_qemu.yml/badge.svg)](/~https://github.com/emmansun/base64/actions/workflows/arm64_qemu.yml) [![ppc64le](/~https://github.com/emmansun/base64/actions/workflows/ppc64le_qemu.yml/badge.svg)](/~https://github.com/emmansun/base64/actions/workflows/ppc64le_qemu.yml) [![s390x](/~https://github.com/emmansun/base64/actions/workflows/s390x_qemu.yml/badge.svg)](/~https://github.com/emmansun/base64/actions/workflows/s390x_qemu.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/emmansun/base64)](https://goreportcard.com/report/github.com/emmansun/base64) [![Documentation](https://godoc.org/github.com/emmansun/base64?status.svg)](https://godoc.org/github.com/emmansun/base64) ![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/emmansun/base64) [![Release](https://img.shields.io/github/release/emmansun/base64/all.svg)](/~https://github.com/emmansun/base64/releases)