From 643b40500584d13d7f8531b052e5ef29697b54a4 Mon Sep 17 00:00:00 2001 From: Stanley Nguyen Date: Fri, 1 May 2020 11:56:25 +0800 Subject: [PATCH] ci(codecov) Add code coverage --- .github/workflows/coverage.yml | 22 ++++++++++++++++++++++ README.md | 1 + 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..0acadd2 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,22 @@ +name: "coverage" + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + name: Send coverage to codecov + steps: + - uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: "1.14" + - run: go mod download + - run: go test -race -coverprofile=coverage.txt -covermode=atomic + - uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt diff --git a/README.md b/README.md index e09009e..62b0e52 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c)](https://pkg.go.dev/github.com/stanleynguyen/is-thirteen) ![](https://github.com/stanleynguyen/is-thirteen/workflows/test/badge.svg) ![](https://github.com/stanleynguyen/is-thirteen/workflows/lint/badge.svg) +[![codecov](https://codecov.io/gh/stanleynguyen/is-thirteen/branch/master/graph/badge.svg)](https://codecov.io/gh/stanleynguyen/is-thirteen) Check if a number is equal to 13. A port of [this NPM module](https://github.com/jezen/is-thirteen).