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] 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: