-
Notifications
You must be signed in to change notification settings - Fork 8
/
@root.yml
130 lines (125 loc) · 3.32 KB
/
@root.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: 2.1
description: |
IPFS is a distributed, content-addressed file system. The ipfs/ci-go Orb is
the shared CI logic used by our go repos.
Orb Source - https://github.com/ipfs/ci-helpers/tree/master/orbs/ci-go
# Don't rely on home, users, etc. We run multiple images that don't agree.
# The one thing we _can_ agree on is that we have root.
environment: &environment
GIT_PAGER: cat
GO111MODULE: "on"
GOPATH: /home/circleci/go
GOCACHE: /home/circleci/go/cache
PATH: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/local/go/bin:/go/bin
IPFS_DISTS: https://dist.ipfs.io
executors:
default:
description: "The official CircleCI Go Docker image."
parameters:
tag:
description: "The `circleci/golang` Docker image version tag."
type: string
default: "1.15.6"
docker:
- image: cimg/go:<< parameters.tag >>
environment:
<<: *environment
macos:
macos:
xcode: "10.0.0"
environment:
<<: *environment
golangci:
description: "GolangCI Linter Image"
parameters:
tag:
description: "GolangCI Version"
type: string
default: "v1.35.2"
docker:
- image: golangci/golangci-lint:<< parameters.tag >>
environment:
<<: *environment
jobs:
benchmark:
description: "Run go benchmarks and fail on regressions."
parameters:
tolerance:
description: "Tolerable slowdown (%)."
type: integer
default: 25
baseline:
description: "Baseline branch to which to compare (if any)."
type: string
default: ""
cmd:
description: "Benchmark command."
type: string
default: go test -run=NONE -bench=. ./...
executor:
description: "Configure the executor for this job"
type: executor
default: default
executor: << parameters.executor >>
environment:
<<: *environment
steps:
- checkout
- restore-cache
- benchtest:
baseline: << parameters.baseline >>
tolerance: << parameters.tolerance >>
cmd: << parameters.cmd >>
- save-cache
build:
description: "Build all packages in this repo."
parameters:
executor:
description: "Configure the executor for this job"
type: executor
default: default
executor: << parameters.executor >>
environment:
<<: *environment
steps:
- checkout
- restore-cache
- check-build-supported
- save-cache
test:
description: "Run the unit tests on the repo"
parameters:
executor:
description: "Configure the executor for this job"
type: executor
default: default
race:
description: "Enable the race detector."
type: boolean
default: false
executor: << parameters.executor >>
environment:
<<: *environment
steps:
- checkout
- restore-cache
- test:
race: << parameters.race >>
- save-cache
test-macos:
description: "Run the unit tests on MacOS"
executor: macos
steps:
- setup-macos
- checkout
- restore-cache
- test
- save-cache
lint:
description: "Run all linters on the repo"
executor: golangci
steps:
- checkout
- restore-cache
- lint
- save-cache