File tree 6 files changed +73
-57
lines changed
6 files changed +73
-57
lines changed Original file line number Diff line number Diff line change 1
1
- With pull requests:
2
2
- Open your pull request against ` master `
3
3
- Your pull request should have no more than two commits, if not you should squash them.
4
- - It should pass all tests in the available continuous integration systems such as TravisCI .
4
+ - It should pass all tests in the available continuous integration systems such as GitHub Actions .
5
5
- You should add/modify tests to cover your proposed code changes.
6
6
- If your pull request contains a new feature, please document it on the README.
7
7
Original file line number Diff line number Diff line change
1
+ name : Run Tests
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ branches :
9
+ - master
10
+
11
+ jobs :
12
+ test :
13
+ strategy :
14
+ matrix :
15
+ os : [ubuntu-latest, macos-latest]
16
+ go : [1.13, 1.14, 1.15, 1.16]
17
+ test-tags : ['', nomsgpack]
18
+ name : ${{ matrix.os }} @ Go ${{ matrix.go }} ${{ matrix.test-tags }}
19
+ runs-on : ${{ matrix.os }}
20
+ env :
21
+ GO111MODULE : on
22
+ TESTTAGS : ${{ matrix.test-tags }}
23
+ GOPROXY : https://proxy.golang.org
24
+ steps :
25
+ - name : Set up Go ${{ matrix.go }}
26
+ uses : actions/setup-go@v2
27
+ with :
28
+ go-version : ${{ matrix.go }}
29
+
30
+ - name : Checkout Code
31
+ uses : actions/checkout@v2
32
+ with :
33
+ ref : ${{ github.ref }}
34
+
35
+ - name : Install Dependencies
36
+ run : make tools
37
+
38
+ - name : Run Check
39
+ run : |
40
+ make vet
41
+ make fmt-check
42
+ make misspell-check
43
+
44
+ - name : Run Tests
45
+ run : make test
46
+
47
+ - name : Upload coverage to Codecov
48
+ uses : codecov/codecov-action@v1
49
+ notification-gitter :
50
+ needs : test
51
+ runs-on : ubuntu-latest
52
+ steps :
53
+ - name : Notification failure message
54
+ if : failure()
55
+ run : |
56
+ PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)"
57
+ curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" -d level=error https://webhooks.gitter.im/e/7f95bf605c4d356372f4
58
+ - name : Notification success message
59
+ if : success()
60
+ run : |
61
+ PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)"
62
+ curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" https://webhooks.gitter.im/e/7f95bf605c4d356372f4
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 8
8
- With pull requests:
9
9
- Open your pull request against ` master `
10
10
- Your pull request should have no more than two commits, if not you should squash them.
11
- - It should pass all tests in the available continuous integration systems such as TravisCI .
11
+ - It should pass all tests in the available continuous integration systems such as GitHub Actions .
12
12
- You should add/modify tests to cover your proposed code changes.
13
13
- If your pull request contains a new feature, please document it on the README.
Original file line number Diff line number Diff line change 1
1
GO ?= go
2
2
GOFMT ?= gofmt "-s"
3
+ GO_VERSION =$(shell $(GO ) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
3
4
PACKAGES ?= $(shell $(GO ) list ./...)
4
5
VETPACKAGES ?= $(shell $(GO ) list ./... | grep -v /examples/)
5
6
GOFILES := $(shell find . -name "* .go")
@@ -67,5 +68,10 @@ misspell:
67
68
68
69
.PHONY : tools
69
70
tools :
70
- go install golang.org/x/lint/golint; \
71
- go install github.com/client9/misspell/cmd/misspell;
71
+ @if [ $( GO_VERSION) -gt 15 ]; then \
72
+ $(GO ) install golang.org/x/lint/golint@latest; \
73
+ $(GO ) install github.com/client9/misspell/cmd/misspell@latest; \
74
+ elif [ $( GO_VERSION) -lt 16 ]; then \
75
+ $(GO ) install golang.org/x/lint/golint; \
76
+ $(GO ) install github.com/client9/misspell/cmd/misspell; \
77
+ fi
Original file line number Diff line number Diff line change 2
2
3
3
<img align =" right " width =" 159px " src =" https://raw.githubusercontent.com/gin-gonic/logo/master/color.png " >
4
4
5
- [ ![ Build Status] ( https://travis-ci.org /gin-gonic/gin.svg )] ( https://travis-ci.org /gin-gonic/gin )
5
+ [ ![ Build Status] ( https://github.com /gin-gonic/gin/workflows/Run%20Tests/badge .svg?branch=master )] ( https://github.com /gin-gonic/gin/actions?query=branch%3Amaster )
6
6
[ ![ codecov] ( https://codecov.io/gh/gin-gonic/gin/branch/master/graph/badge.svg )] ( https://codecov.io/gh/gin-gonic/gin )
7
7
[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/gin-gonic/gin )] ( https://goreportcard.com/report/github.com/gin-gonic/gin )
8
8
[ ![ GoDoc] ( https://pkg.go.dev/badge/github.com/gin-gonic/gin?status.svg )] ( https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc )
You can’t perform that action at this time.
0 commit comments