Skip to content

Commit 0a074bd

Browse files
committed
Added CircleCI build configuration
1 parent ce76eb2 commit 0a074bd

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.circleci/config.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
defaults: &defaults
2+
docker:
3+
- image: circleci/golang:1.11
4+
environment:
5+
GO111MODULE: "on"
6+
working_directory: /go/src/github.com/ernoaapa/kubectl-warp
7+
8+
version: 2
9+
jobs:
10+
test:
11+
<<: *defaults
12+
steps:
13+
- checkout
14+
15+
# Temporary hack to install packages and not fail to checksum mismatch error
16+
# https://github.com/golang/go/issues/27925#issuecomment-440608747
17+
- run: rm go.sum
18+
19+
- run: "! go fmt -l pkg cmd 2>&1 | read"
20+
- run: go vet ./...
21+
- run: go test ./...
22+
23+
build:
24+
<<: *defaults
25+
steps:
26+
- checkout
27+
28+
# Temporary hack to install packages and not fail to checksum mismatch error
29+
# https://github.com/golang/go/issues/27925#issuecomment-440608747
30+
- run: rm go.sum
31+
32+
- run: go build .
33+
34+
- run: wget -qO- https://github.com/goreleaser/goreleaser/releases/download/v0.95.0/goreleaser_Linux_x86_64.tar.gz | tar xvz
35+
- run: ./goreleaser --snapshot
36+
37+
publish:
38+
<<: *defaults
39+
steps:
40+
- checkout
41+
42+
# Temporary hack to install packages and not fail to checksum mismatch error
43+
# https://github.com/golang/go/issues/27925#issuecomment-440608747
44+
- run: rm go.sum
45+
46+
- run: go build .
47+
48+
- run: wget -qO- https://github.com/goreleaser/goreleaser/releases/download/v0.95.0/goreleaser_Linux_x86_64.tar.gz | tar xvz
49+
- run: ./goreleaser
50+
51+
workflows:
52+
version: 2
53+
build_and_test:
54+
jobs:
55+
- test
56+
57+
- build:
58+
requires:
59+
- test
60+
61+
- publish:
62+
requires:
63+
- build
64+
65+
# Don't run when branches updates, only when tags get created
66+
filters:
67+
tags:
68+
only:
69+
- /v.*/

0 commit comments

Comments
 (0)