浏览代码

add ci and badge

Tao Wen 7 年之前
父节点
当前提交
7d04878ff6
共有 4 个文件被更改,包括 60 次插入1 次删除
  1. 14 0
      .travis.yml
  2. 10 1
      README.md
  3. 24 0
      coverage.txt
  4. 12 0
      test.sh

+ 14 - 0
.travis.yml

@@ -0,0 +1,14 @@
+language: go
+
+go:
+  - 1.8.x
+  - 1.x
+
+before_install:
+  - go get -t -v ./...
+
+script:
+  - ./test.sh
+
+after_success:
+  - bash <(curl -s https://codecov.io/bash)

+ 10 - 1
README.md

@@ -1,2 +1,11 @@
 # concurrent
 # concurrent
-concurrency utilities
+
+[![Sourcegraph](https://sourcegraph.com/github.com/modern-go/concurrent/-/badge.svg)](https://sourcegraph.com/github.com/modern-go/concurrent?badge)
+[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/modern-go/concurrent)
+[![Build Status](https://travis-ci.org/modern-go/concurrent.svg?branch=master)](https://travis-ci.org/modern-go/concurrent)
+[![codecov](https://codecov.io/gh/modern-go/concurrent/branch/master/graph/badge.svg)](https://codecov.io/gh/modern-go/concurrent)
+[![rcard](https://goreportcard.com/badge/github.com/modern-go/concurrent)](https://goreportcard.com/report/github.com/modern-go/concurrent)
+[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://raw.githubusercontent.com/modern-go/concurrent/master/LICENSE)
+
+* concurrent.Map: backport sync.Map for go below 1.9
+* concurrent.Executor: goroutine with explicit ownership and cancellable

+ 24 - 0
coverage.txt

@@ -0,0 +1,24 @@
+
+mode: set
+github.com/modern-go/concurrent/go_above_19.go:13.20,15.2 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:14.61,15.2 0 0
+github.com/modern-go/concurrent/unbounded_executor.go:18.83,22.2 3 0
+github.com/modern-go/concurrent/unbounded_executor.go:44.48,52.2 2 1
+github.com/modern-go/concurrent/unbounded_executor.go:56.74,62.12 6 1
+github.com/modern-go/concurrent/unbounded_executor.go:62.12,63.16 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:72.3,72.24 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:63.16,65.51 2 1
+github.com/modern-go/concurrent/unbounded_executor.go:68.4,70.45 3 1
+github.com/modern-go/concurrent/unbounded_executor.go:65.51,67.5 1 0
+github.com/modern-go/concurrent/unbounded_executor.go:77.43,79.2 1 0
+github.com/modern-go/concurrent/unbounded_executor.go:83.57,85.2 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:89.69,91.6 2 1
+github.com/modern-go/concurrent/unbounded_executor.go:91.6,93.10 2 1
+github.com/modern-go/concurrent/unbounded_executor.go:98.3,98.33 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:94.24,94.24 0 1
+github.com/modern-go/concurrent/unbounded_executor.go:95.21,96.10 1 0
+github.com/modern-go/concurrent/unbounded_executor.go:98.33,100.4 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:104.59,107.58 3 1
+github.com/modern-go/concurrent/unbounded_executor.go:115.2,115.13 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:107.58,108.16 1 1
+github.com/modern-go/concurrent/unbounded_executor.go:108.16,113.4 2 0

+ 12 - 0
test.sh

@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+set -e
+echo "" > coverage.txt
+
+for d in $(go list ./... | grep -v vendor); do
+    go test -coverprofile=profile.out -coverpkg=github.com/modern-go/concurrent $d
+    if [ -f profile.out ]; then
+        cat profile.out >> coverage.txt
+        rm profile.out
+    fi
+done