-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yml
94 lines (91 loc) · 2.34 KB
/
config.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
version: 2.1
executors:
build-executor:
docker:
- image: hairyhenderson/gomplate-ci-build:latest
working_directory: /go/src/github.com/hairyhenderson/go-which
jobs:
test-vendoring:
executor: build-executor
environment:
GO111MODULE: 'on'
GOFLAGS: -mod=vendor
steps:
- checkout
- run: go mod tidy
- run: go mod vendor
- run: go mod verify
- run:
name: ensure clean git repo
command: |
git status -sb
git diff
test -z "$(git status --porcelain=v2)"
build:
executor: build-executor
steps:
- checkout
- run: make build
- persist_to_workspace:
root: /go
paths:
- .
lint:
executor: build-executor
steps:
- checkout
- run: make lint
test:
executor: build-executor
steps:
- attach_workspace:
at: /go
- run: cc-test-reporter before-build
- run:
name: make test
command: |
trap "go-junit-report < /tmp/test-results/go-test.out > /tmp/test-results/report.xml" EXIT
make test | tee /tmp/test-results/go-test.out
echo $? > test.exit
- store_test_results:
path: /tmp/test-results
- run: cc-test-reporter after-build --exit-code $(< test.exit)
- store_artifacts:
path: bin
destination: binaries
integration:
executor: build-executor
steps:
- attach_workspace:
at: /go
- run:
name: make integration
command: |
trap "go-junit-report < /tmp/test-results/go-integration.out > /tmp/test-results/integration-report.xml" EXIT
make integration | tee /tmp/test-results/go-integration.out
echo $? > integration.exit
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: bin
destination: binaries
docker-images:
executor: build-executor
steps:
- checkout
- setup_remote_docker:
version: 18.09.3
- run: make artifacts.tag latest.tag alpine.tag slim.tag
workflows:
build-and-test:
jobs:
# - test-vendoring
- build
- test:
requires:
- build
- integration:
requires:
- build
- lint
- docker-images