diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e2f2029 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: test + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + go-version: ['>=1.18.0'] + os: [ubuntu-latest,] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Unshallow git checkout + run: git fetch --prune --unshallow + - name: Run tests + run: go test -v -covermode=count -coverprofile=coverage.out ./... + - name: Convert coverage to lcov + uses: jandelgado/gcov2lcov-action@v1.0.5 + - name: Report coverage + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage.lcov diff --git a/Makefile b/Makefile index 7e4c539..4108d79 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ # Test test: - go test -v -cover -coverprofile=coverage.out ./... + go test -v -failfast -count=1 -cover -covermode=count -coverprofile=coverage.out ./... + go tool cover -func coverage.out -.phony: test \ No newline at end of file +.phony: test diff --git a/README.md b/README.md index e3b570d..8fb858a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +[![test](https://github.com/davesavic/clink/workflows/test/badge.svg)](https://github.com/davesavic/clink/actions?query=workflow%3Atest) +[![coverage](https://coveralls.io/repos/github/davesavic/clink/badge.svg?branch=main)](https://coveralls.io/github/davesavic/clink?branch=main) +[![goreportcard](https://goreportcard.com/badge/github.com/davesavic/clink)](https://goreportcard.com/report/github.com/davesavic/clink) +[![gopkg](https://pkg.go.dev/badge/github.com/davesavic/clink.svg)](https://pkg.go.dev/github.com/davesavic/clink) +[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davesavic/clink/blob/master/LICENSE) + + + ## Clink: A Configurable HTTP Client for Go Clink is a highly configurable HTTP client for Go, designed for ease of use, extendability, and robustness. It supports various features like automatic retries and request rate limiting, making it ideal for both simple and advanced HTTP requests. @@ -52,4 +60,4 @@ func main() { For more examples, see the [examples](https://github.com/davesavic/clink/tree/master/examples) directory. ### Contributing -Contributions to Clink are welcome! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request. \ No newline at end of file +Contributions to Clink are welcome! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request.