1
- version : 2
2
- jobs :
3
- build :
1
+ version : 2.1
2
+
3
+ commands :
4
+ configure_bazel :
5
+ description : Create Bazel config file (.bazelrc)
6
+ steps :
7
+ - run : |
8
+ cat > .bazelrc \<< EOF
9
+ startup --output_base /root/.cache/_grpc_gateway_bazel
10
+ build --test_output errors
11
+ build --features race
12
+ # Workaround https://github.com/bazelbuild/bazel/issues/3645
13
+ # See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
14
+ build --local_ram_resources=4096 # Circle Docker runners have 4G of memory
15
+ build --local_cpu_resources=2 # Circle Docker runners have 2 vCPU
16
+ EOF
17
+ generate :
18
+ steps :
19
+ - run : make realclean
20
+ - run : make examples
21
+ - run : make testproto
22
+ - run : go mod tidy
23
+ renovate_git_amend_push :
24
+ description : Git amend and push changes
25
+ steps :
26
+ - run : |
27
+ git add .
28
+ if output=$(git status --porcelain) && [ ! -z "$output" ]; then
29
+ git config user.name "Renovate Bot"
30
+ git config user.email "[email protected] "
31
+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/grpc-ecosystem/grpc-gateway.git
32
+ git commit --amend --no-edit
33
+ git push --force-with-lease origin ${CIRCLE_BRANCH}
34
+ fi
35
+
36
+ executors :
37
+ build-env :
4
38
environment :
5
39
# # Split key to avoid github from revoking it
6
40
password0 : ' 99544cdcb19ad4e3fd64'
7
41
password1 : ' 3ec86b2e5a431be2d72c'
42
+ GLOG_logtostderr : ' 1'
8
43
docker :
9
44
- image : docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
10
45
auth :
11
46
username : gateway-ci-user
12
47
password : ${password0}${password1}
48
+
49
+ jobs :
50
+ build :
51
+ executor : build-env
13
52
working_directory : /src/grpc-gateway
14
53
steps :
15
54
- checkout
16
55
- run : go build ./...
17
56
test :
18
- environment :
19
- # # Split key to avoid github from revoking it
20
- password0 : ' 99544cdcb19ad4e3fd64'
21
- password1 : ' 3ec86b2e5a431be2d72c'
22
- GLOG_logtostderr : ' 1'
23
- docker :
24
- - image : docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
25
- auth :
26
- username : gateway-ci-user
27
- password : ${password0}${password1}
57
+ executor : build-env
28
58
working_directory : /src/grpc-gateway
29
59
steps :
30
60
- checkout
31
61
- run : go test -race -coverprofile=coverage.txt ./...
32
62
- run : bash <(curl -s https://codecov.io/bash)
33
63
node_test :
34
- environment :
35
- # # Split key to avoid github from revoking it
36
- password0 : ' 99544cdcb19ad4e3fd64'
37
- password1 : ' 3ec86b2e5a431be2d72c'
38
- docker :
39
- - image : docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
40
- auth :
41
- username : gateway-ci-user
42
- password : ${password0}${password1}
64
+ executor : build-env
43
65
working_directory : /src/grpc-gateway
44
66
steps :
45
67
- checkout
@@ -51,33 +73,14 @@ jobs:
51
73
npm install &&
52
74
./node_modules/.bin/gulp
53
75
generate :
54
- environment :
55
- # # Split key to avoid github from revoking it
56
- password0 : ' 99544cdcb19ad4e3fd64'
57
- password1 : ' 3ec86b2e5a431be2d72c'
58
- docker :
59
- - image : docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
60
- auth :
61
- username : gateway-ci-user
62
- password : ${password0}${password1}
76
+ executor : build-env
63
77
working_directory : /src/grpc-gateway
64
78
steps :
65
79
- checkout
66
- - run : make realclean
67
- - run : make examples
68
- - run : make testproto
69
- - run : go mod tidy
80
+ - generate
70
81
- run : git diff --exit-code
71
82
lint :
72
- environment :
73
- # # Split key to avoid github from revoking it
74
- password0 : ' 99544cdcb19ad4e3fd64'
75
- password1 : ' 3ec86b2e5a431be2d72c'
76
- docker :
77
- - image : docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
78
- auth :
79
- username : gateway-ci-user
80
- password : ${password0}${password1}
83
+ executor : build-env
81
84
working_directory : /src/grpc-gateway
82
85
steps :
83
86
- checkout
@@ -101,18 +104,7 @@ jobs:
101
104
keys :
102
105
- v2-bazel-cache-{{ checksum "repositories.bzl" }}
103
106
- v2-bazel-cache-
104
- - run :
105
- name : Create Bazel config file (.bazelrc)
106
- command : |
107
- cat > .bazelrc << EOF
108
- startup --output_base /root/.cache/_grpc_gateway_bazel
109
- build --test_output errors
110
- build --features race
111
- # Workaround https://github.com/bazelbuild/bazel/issues/3645
112
- # See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
113
- build --local_ram_resources=3072
114
- build --local_cpu_resources=1
115
- EOF
107
+ - configure_bazel
116
108
- run :
117
109
name : Check that Bazel BUILD files are up-to-date
118
110
command : ' bazel run //:gazelle -- --mode=diff ||
@@ -130,15 +122,7 @@ jobs:
130
122
paths :
131
123
- /root/.cache/_grpc_gateway_bazel
132
124
gorelease :
133
- environment :
134
- # # Split key to avoid github from revoking it
135
- password0 : ' 99544cdcb19ad4e3fd64'
136
- password1 : ' 3ec86b2e5a431be2d72c'
137
- docker :
138
- - image : docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
139
- auth :
140
- username : gateway-ci-user
141
- password : ${password0}${password1}
125
+ executor : build-env
142
126
working_directory : /src/grpc-gateway
143
127
steps :
144
128
- checkout
@@ -150,20 +134,35 @@ jobs:
150
134
go get golang.org/x/exp/cmd/gorelease@latest
151
135
- run : gorelease
152
136
release :
153
- environment :
154
- # # Split key to avoid github from revoking it
155
- password0 : ' 99544cdcb19ad4e3fd64'
156
- password1 : ' 3ec86b2e5a431be2d72c'
157
- docker :
158
- - image : docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
159
- auth :
160
- username : gateway-ci-user
161
- password : ${password0}${password1}
137
+ executor : build-env
162
138
working_directory : /src/grpc-gateway
163
139
steps :
164
140
- checkout
165
141
- run : go mod vendor
166
142
- run : curl -sL https://git.io/goreleaser | bash
143
+ update-repositoriesbzl :
144
+ docker :
145
+ - image : l.gcr.io/google/bazel:latest
146
+ working_directory : /src/grpc-gateway
147
+ steps :
148
+ - checkout
149
+ - restore_cache :
150
+ keys :
151
+ - v2-bazel-cache-{{ checksum "repositories.bzl" }}
152
+ - v2-bazel-cache-
153
+ - configure_bazel
154
+ - run :
155
+ name : Update repositories.bzl
156
+ command : |
157
+ bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories
158
+ - renovate_git_amend_push
159
+ regenerate :
160
+ executor : build-env
161
+ working_directory : /src/grpc-gateway
162
+ steps :
163
+ - checkout
164
+ - generate
165
+ - renovate_git_amend_push
167
166
workflows :
168
167
version : 2
169
168
all :
@@ -182,3 +181,20 @@ workflows:
182
181
ignore : /.*/
183
182
tags :
184
183
only : /v[0-9]+(\.[0-9]+)*(-.*)*/
184
+ - update-repositoriesbzl :
185
+ filters :
186
+ branches :
187
+ only : /renovate\/.+/
188
+ tags :
189
+ ignore : /.*/
190
+ - regenerate :
191
+ requires :
192
+ # Run after update-repositoriesbzl to avoid
193
+ # git conflicts
194
+ - update-repositoriesbzl
195
+ filters :
196
+ branches :
197
+ only : /renovate\/master-.+/
198
+ tags :
199
+ ignore : /.*/
200
+
0 commit comments