From 75a323fb7a70a32915cd68e21dfaba7fd48308a9 Mon Sep 17 00:00:00 2001 From: "Edwin Liu (RD-TW)" Date: Mon, 9 Sep 2019 00:32:04 +0800 Subject: [PATCH 1/2] Add the CircleCI config --- .circleci/config.yml | 20 ++++++++++++++++++++ .gitignore | 4 ++-- Makefile | 4 ++-- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 .circleci/config.yml 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: From 06f6c20828d5344b1b7b500c3d755256fb89f898 Mon Sep 17 00:00:00 2001 From: "Edwin Liu (RD-TW)" Date: Mon, 9 Sep 2019 00:35:14 +0800 Subject: [PATCH 2/2] Add badges to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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).