From 31a36fb665b1d18319ddff6312d5c0bed5b971da Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:16:14 +0200 Subject: [PATCH 1/2] doc: add badges --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c681765..bd73973 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Go SafeCast +[![Go Report Card](https://goreportcard.com/badge/github.com/ccoveille/go-safecast)](https://goreportcard.com/report/github.com/ccoveille/go-safecast) +[![GoDoc](https://godoc.org/github.com/ccoVeille/go-safecast?status.svg)](https://godoc.org/github.com/ccoVeille/go-safecast) +[![codecov](https://codecov.io/gh/ccoVeille/go-safecast/graph/badge.svg?token=VW0VO503U6)](https://codecov.io/gh/ccoVeille/go-safecast) +[![Code Climate](https://codeclimate.com/github/ccoVeille/go-safecast.png)](https://codeclimate.com/github/ccoVeille/go-safecast) + ## Origin of this project In Go, integer type conversion can lead to unexpected behavior and errors if not handled carefully. From 112e9d7932bffad82420fbe4043a90650c61c6e4 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:16:36 +0200 Subject: [PATCH 2/2] ci: fix coverage not launched on merge --- .github/workflows/coverage.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 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..f30b358 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,26 @@ +--- +name: Coverage +on: + push: + branches: + - main +jobs: + go-lint: + runs-on: ubuntu-latest + steps: + - name: checkout-action + uses: actions/checkout@v4.1.7 + + - name: Set up Go + uses: actions/setup-go@v5 + + - name: Run tests + run: go test -coverprofile=coverage.txt + + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Launch golangci-lint + uses: golangci/golangci-lint-action@v6.1.0