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 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.