From 1f676fe1660067d76f86a6fa1c8d35902357f7c6 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 12 Aug 2019 13:43:12 +0800 Subject: [PATCH 1/5] new format drone --- .drone.yml | 121 +++++++++++++++++++++++++++++++++++++++++------- context_test.go | 4 +- 2 files changed, 104 insertions(+), 21 deletions(-) diff --git a/.drone.yml b/.drone.yml index f8f9979..6e4d5cb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,26 +1,111 @@ +--- +kind: pipeline +name: go110 + +platform: + os: linux + arch: amd64 + +clone: + disable: true + workspace: base: /go path: src/gitea.com/lunny/tango -clone: - git: - image: plugins/git:next +steps: +- name: git + pull: default + image: plugins/git:next + settings: depth: 50 tags: true -matrix: - GO_VERSION: - - 1.8 - - 1.9 - - 1.10 - - 1.11 +- name: test + pull: default + image: golang:1.10 + commands: + - go get -t -d -v ./... + - go build -v + - go vet ./... + - go test -v -race -coverprofile=coverage.txt -covermode=atomic + when: + event: + - push + - pull_request -pipeline: - test: - image: golang:${GO_VERSION} - commands: - - go get -t -d -v ./... - - go build -v - - go test -v -race -coverprofile=coverage.txt -covermode=atomic - when: - event: [ push, pull_request ] \ No newline at end of file +--- +kind: pipeline +name: go111 + +platform: + os: linux + arch: amd64 + +clone: + disable: true + +workspace: + base: /go + path: src/gitea.com/lunny/tango + +steps: +- name: git + pull: default + image: plugins/git:next + settings: + depth: 50 + tags: true + +- name: test + pull: default + image: golang:1.11 + environment: + - GO111MODULE: on + - GOPROXY: https://goproxy.cn + commands: + - go build -v + - go vet ./... + - go test -v -race -coverprofile=coverage.txt -covermode=atomic + when: + event: + - push + - pull_request + +--- +kind: pipeline +name: go112 + +platform: + os: linux + arch: amd64 + +clone: + disable: true + +workspace: + base: /go + path: src/gitea.com/lunny/tango + +steps: +- name: git + pull: default + image: plugins/git:next + settings: + depth: 50 + tags: true + +- name: test + pull: default + image: golang:1.12 + environment: + - GO111MODULE: on + - GOPROXY: https://goproxy.cn + commands: + - go build -v + - go vet ./... + - go test -v -race -coverprofile=coverage.txt -covermode=atomic + when: + event: + - push + - pull_request \ No newline at end of file diff --git a/context_test.go b/context_test.go index 977ef4b..8220c91 100644 --- a/context_test.go +++ b/context_test.go @@ -459,9 +459,7 @@ func TestContextActionTag(t *testing.T) { } tagName := ctx.ActionTag("Name") - if tagName == "name" { - fmt.Println("find the action") - } + expect(t, "name", tagName) })) o.Get("/", new(ActionTag)) -- 2.40.1 From 0c6e6304ee44a311046789ebe62d5d6277c2d4e1 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 12 Aug 2019 13:44:29 +0800 Subject: [PATCH 2/5] fix drone file --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6e4d5cb..c02a25e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -61,8 +61,8 @@ steps: pull: default image: golang:1.11 environment: - - GO111MODULE: on - - GOPROXY: https://goproxy.cn + - GO111MODULE=on + - GOPROXY=https://goproxy.cn commands: - go build -v - go vet ./... @@ -99,8 +99,8 @@ steps: pull: default image: golang:1.12 environment: - - GO111MODULE: on - - GOPROXY: https://goproxy.cn + - GO111MODULE=on + - GOPROXY=https://goproxy.cn commands: - go build -v - go vet ./... -- 2.40.1 From 7e245007d3c9337f3f2b5cd01ca4d308f03343bc Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 13 Aug 2019 15:15:45 +0800 Subject: [PATCH 3/5] update drone --- .drone.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index c02a25e..993e96d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,25 +14,25 @@ workspace: path: src/gitea.com/lunny/tango steps: -- name: git - pull: default - image: plugins/git:next - settings: - depth: 50 - tags: true + - name: git + pull: default + image: plugins/git:next + settings: + depth: 50 + tags: true -- name: test - pull: default - image: golang:1.10 - commands: - - go get -t -d -v ./... - - go build -v - - go vet ./... - - go test -v -race -coverprofile=coverage.txt -covermode=atomic - when: - event: - - push - - pull_request + - name: test + pull: default + image: golang:1.10 + commands: + - go get -t -d -v ./... + - go build -v + - go vet ./... + - go test -v -race -coverprofile=coverage.txt -covermode=atomic + when: + event: + - push + - pull_request --- kind: pipeline @@ -47,7 +47,7 @@ clone: workspace: base: /go - path: src/gitea.com/lunny/tango + path: src/tango111 steps: - name: git @@ -85,7 +85,7 @@ clone: workspace: base: /go - path: src/gitea.com/lunny/tango + path: src/tango112 steps: - name: git -- 2.40.1 From ed7038bfb41f97e8ff90191fd06baa3ae2fedbb5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 13 Aug 2019 15:16:33 +0800 Subject: [PATCH 4/5] update drone --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 993e96d..3b6374a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -61,8 +61,8 @@ steps: pull: default image: golang:1.11 environment: - - GO111MODULE=on - - GOPROXY=https://goproxy.cn + GO111MODULE: on + GOPROXY: https://goproxy.cn commands: - go build -v - go vet ./... @@ -99,8 +99,8 @@ steps: pull: default image: golang:1.12 environment: - - GO111MODULE=on - - GOPROXY=https://goproxy.cn + GO111MODULE: on + GOPROXY: https://goproxy.cn commands: - go build -v - go vet ./... -- 2.40.1 From 5e8a5d6bba52bf73dd4df95fa9620da81408c162 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 13 Aug 2019 15:39:04 +0800 Subject: [PATCH 5/5] fix vet --- context_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/context_test.go b/context_test.go index 8220c91..e3a1865 100644 --- a/context_test.go +++ b/context_test.go @@ -437,7 +437,7 @@ func TestContextDecodeXML(t *testing.T) { } type ActionTag struct { - Name string `name` + Name string `tag:"name"` } func (a *ActionTag) Get() interface{} { @@ -459,7 +459,7 @@ func TestContextActionTag(t *testing.T) { } tagName := ctx.ActionTag("Name") - expect(t, "name", tagName) + expect(t, `tag:"name"`, tagName) })) o.Get("/", new(ActionTag)) -- 2.40.1