Skip to content

Commit 346356f

Browse files
authored
Merge pull request #719 from simonpasquier/enable-circleci
Add Circle CI configuration
2 parents 5538bed + 2725e8e commit 346356f

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.circleci/config.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
version: 2.1
3+
4+
orbs:
5+
go: circleci/[email protected]
6+
7+
jobs:
8+
test:
9+
parameters:
10+
go_version:
11+
type: string
12+
run_style:
13+
type: boolean
14+
default: false
15+
run_lint:
16+
type: boolean
17+
default: false
18+
use_gomod_cache:
19+
type: boolean
20+
default: true
21+
docker:
22+
- image: circleci/golang:<< parameters.go_version >>
23+
working_directory: /go/src/github.com/prometheus/client_golang
24+
steps:
25+
- checkout
26+
- when:
27+
condition: << parameters.use_gomod_cache >>
28+
steps:
29+
- go/load-cache:
30+
key: v1-go<< parameters.go_version >>
31+
- run: make check_license unused test
32+
- when:
33+
condition: << parameters.run_lint >>
34+
steps:
35+
- run: make lint
36+
- when:
37+
condition: << parameters.run_style >>
38+
steps:
39+
- run: make style
40+
- when:
41+
condition: << parameters.use_gomod_cache >>
42+
steps:
43+
- go/save-cache:
44+
key: v1-go<< parameters.go_version >>
45+
- store_test_results:
46+
path: test-results
47+
48+
workflows:
49+
version: 2
50+
client_golang:
51+
jobs:
52+
# Refer to README.md for the currently supported versions.
53+
- test:
54+
name: go-1-9
55+
go_version: "1.9"
56+
use_gomod_cache: false
57+
- test:
58+
name: go-1-10
59+
go_version: "1.10"
60+
use_gomod_cache: false
61+
- test:
62+
name: go-1-11
63+
go_version: "1.11"
64+
run_lint: true
65+
- test:
66+
name: go-1-12
67+
go_version: "1.12"
68+
run_lint: true
69+
- test:
70+
name: go-1-13
71+
go_version: "1.13"
72+
run_lint: true
73+
# Style is only checked against the latest supported Go version.
74+
run_style: true

0 commit comments

Comments
 (0)