-
Notifications
You must be signed in to change notification settings - Fork 581
/
Copy pathtests.yaml
44 lines (44 loc) · 1.14 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: golang-test
spec:
params:
- name: package
description: package (and its children) under test
- name: packages
description: "packages to test (default: ./...)"
default: "./..."
- name: version
description: golang version to use for tests
default: "latest"
- name: flags
description: flags to use for the test command
default: -race -cover -v
- name: GOOS
description: "running program's operating system target"
default: linux
- name: GOARCH
description: "running program's architecture target"
default: amd64
- name: GO111MODULE
description: "value of module support"
default: auto
workspaces:
- name: source
mountPath: /workspace/src/$(params.package)
steps:
- name: unit-test
image: golang:$(params.version)
workingDir: $(workspaces.source.path)
script: |
go test $(params.flags) $(params.packages)
env:
- name: GOPATH
value: /workspace
- name: GOOS
value: "$(params.GOOS)"
- name: GOARCH
value: "$(params.GOARCH)"
- name: GO111MODULE
value: "$(params.GO111MODULE)"