diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..772b61d --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,20 @@ +version: 2 + +jobs: + test: + docker: + - image: circleci/golang:1.13 + steps: + - checkout + - run: + name: Run the testing + command: make test + - run: + name: Upload coverage data to Codecov + command: bash <(curl -s https://codecov.io/bash) + +workflows: + version: 2 + commit-pipeline: + jobs: + - test diff --git a/.gitignore b/.gitignore index 3d38ba8..47bba13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -.coverprofile -.coverprofile.html +coverage.txt +coverage.html # Created by https://www.gitignore.io/api/macos,windows,linux,vim,jetbrains # Edit at https://www.gitignore.io/?templates=macos,windows,linux,vim,jetbrains diff --git a/Makefile b/Makefile index 222e304..5131c5d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: test test: - go test -coverprofile .coverprofile -timeout 10m ./... - go tool cover -html .coverprofile -o .coverprofile.html + go test -race -coverprofile=coverage.txt -covermode=atomic -timeout=10m ./... + go tool cover -html coverage.txt -o coverage.html .PHONY: benchmark benchmark: diff --git a/README.md b/README.md index 765e7db..dd220b8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Poker -[![GoDoc](https://godoc.org/github.com/chehsunliu/poker?status.svg)](https://godoc.org/github.com/chehsunliu/poker) +[![CircleCI](https://circleci.com/gh/chehsunliu/poker/tree/master.svg?style=shield&circle-token=abebd63b852ce8ecdcdf3f7e597be743d07402e4)](https://circleci.com/gh/chehsunliu/poker/tree/master) [![GoDoc](https://godoc.org/github.com/chehsunliu/poker?status.svg)](https://godoc.org/github.com/chehsunliu/poker) [![codecov](https://codecov.io/gh/chehsunliu/poker/branch/master/graph/badge.svg)](https://codecov.io/gh/chehsunliu/poker) Poker is ported from the Python library [worldveil/deuces](https://github.com/worldveil/deuces).