diff --git a/.drone.yml b/.drone.yml index 2c8d4da..b946155 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,10 @@ -# .drone.yml -kind: pipeline -name: default +workspace: + base: /go + path: src/gogs.kikakika.com/lihongfeng/first -steps: -- name: run - image: golang - commands: - - go build +pipeline: + build: + image: golang:1.10.2 + commands: + - go test + - go build diff --git a/main.go b/main.go index 52a7925..a83e54f 100644 --- a/main.go +++ b/main.go @@ -5,5 +5,9 @@ import ( ) func main() { - fmt.Println("hello world") + fmt.Printf("hello world") +} + +func hello() string { + return "hello world" } diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..1a5a8cc --- /dev/null +++ b/main_test.go @@ -0,0 +1,9 @@ +package main + +import "testing" + +func TestHello(t *testing.T) { + if hello() != "hello world" { + t.Error("Testing error") + } +}