11version : 2.1
22
33jobs :
4- ruby_style : &bazel_defaults
4+ rubocop : &bazel_defaults
55 working_directory : /home/circleci/repo
66 resource_class : medium
77 docker :
@@ -15,145 +15,98 @@ jobs:
1515
1616 steps :
1717 - checkout
18- - restore_cache :
19- keys :
20- - v1-dependencies-{{ checksum "Gemfile.lock" }}
18+
2119 - run :
22- name : Install Bundler
20+ name : " Install ~/.bazelrc and run setup "
2321 command : |
24- gem install bundler:2.0.2 --no-doc
25- bundle install --jobs=4 --retry=3 --path ${BUNDLE_PATH}
26-
27- - save_cache :
28- paths :
29- - ${BUNDLE_PATH}
30- key : v1-dependencies-{{ checksum "Gemfile.lock" }}
22+ cp .circleci/.bazelrc ${HOME}
23+ /usr/bin/env bash bin/setup
3124
3225 - run :
33- name : Which everything?
26+ name : Install Bundler
3427 command : |
35- set +e
36- bundle -v
37- ruby --version
38- gcc --version | head -1
39- cc --version | head -1
40- openssl version
28+ gem install bundler:2.0.2 --no-doc
29+ bundle install --jobs=4 --retry=3 --path ${BUNDLE_PATH}
4130
4231 - run :
4332 name : " Rubocop Style Check"
4433 command : bundle exec rubocop -E -P
4534
46- bazel_rules :
35+ bazel_build_workspace :
4736 << : *bazel_defaults
4837
4938 steps :
5039 - checkout
51- - restore_cache :
52- keys :
53- - v1-bazel-{{ checksum ".bazelversion" }}
54- - run :
55- name : " Custom Setup Script"
56- command : |
57- /usr/bin/env bash bin/setup-linux
58-
59- - save_cache :
60- paths :
61- - ${BUNDLE_PATH}
62- key : v1-bazel-{{ checksum ".bazelversion" }}
6340
6441 - run :
65- name : " Install ~/.bazelrc"
42+ name : " Install ~/.bazelrc and run setup "
6643 command : |
6744 cp .circleci/.bazelrc ${HOME}
45+ /usr/bin/env bash bin/setup
6846
6947 - run :
7048 name : " Show Bazel Info"
7149 command : |
72- bazel $BAZEL_OPTS version
73- bazel $BAZEL_OPTS info
74- bazel $BAZEL_OPTS fetch --curses=no -- "//ruby/..."
75- (cd examples && bazel $BAZEL_OPTS fetch --curses=no -- "//...")
50+
51+ /usr/bin/env bash bin/ci bazel-info
7652
7753 - run :
78- name : " Bazel Rules Build"
54+ name : " Bazel Build & Test Workspace "
7955 command : |
80- bazel ${BAZEL_OPTS} build ${BAZEL_BUILD_OPTS} -- //...
56+ /usr/bin/env bash bin/ci workspace
8157
82- - run :
83- name : " Bazel Rules Test"
84- command : |
85- bazel ${BAZEL_OPTS} test ${BAZEL_BUILD_OPTS} ${BAZEL_TEST_OPTS} -- //...
86-
87- bazel_examples :
58+ bazel_build_examples :
8859 << : *bazel_defaults
8960
9061 steps :
9162 - checkout
9263
93- - restore_cache :
94- keys :
95- - v1-bazel-{{ checksum ".bazelversion" }}
96-
9764 - run :
98- name : " Custom Setup Script "
65+ name : " Install ~/.bazelrc and run setup "
9966 command : |
100- /usr/bin/env bash bin/setup-linux
101-
102- - save_cache :
103- paths :
104- - ${BUNDLE_PATH}
105- key : v1-bazel-{{ checksum ".bazelversion" }}
67+ cp .circleci/.bazelrc ${HOME}
68+ /usr/bin/env bash bin/setup
10669
10770 - run :
108- name : " Install ~/.bazelrc "
71+ name : " Bazel Simple Script Example Build "
10972 command : |
110- cp .circleci/.bazelrc ${HOME}
73+ cd examples/simple_script && bazel ${BAZEL_OPTS} build ${BAZEL_BUILD_OPTS} -- //...
11174
11275 - run :
113- name : " Bazel Examples Build "
76+ name : " Bazel Simple Script Example Test "
11477 command : |
115- ( cd examples/simple_script && bazel ${BAZEL_OPTS} build ${BAZEL_BUILD_OPTS} -- //...)
78+ cd examples/simple_script && bazel ${BAZEL_OPTS} test ${BAZEL_BUILD_OPTS} ${BAZEL_TEST_OPTS} -- //...
11679
11780 - run :
118- name : " Bazel Examples Test "
81+ name : " Bazel Simple Script Example Rubocop Check "
11982 command : |
120- ( cd examples/simple_script && bazel ${BAZEL_OPTS} test ${BAZEL_BUILD_OPTS} ${BAZEL_TEST_OPTS} -- //...)
83+ cd examples/simple_script && bazel ${BAZEL_OPTS} run ${BAZEL_BUILD_OPTS} -- :rubocop
12184
122- bazel_buildifier :
85+ buildifier :
12386 << : *bazel_defaults
12487
12588 steps :
12689 - checkout
12790
128- - restore_cache :
129- keys :
130- - v1-bazel-{{ checksum ".bazelversion" }}
131-
13291 - run :
133- name : " Custom Setup Script "
92+ name : " Install ~/.bazelrc and run setup "
13493 command : |
135- /usr/bin/env bash bin/setup-linux
136-
137- - save_cache :
138- paths :
139- - ${BAZEL_INSTALLER_DIR}
140- key : v1-bazel-{{ checksum ".bazelversion" }}
94+ cp .circleci/.bazelrc ${HOME}
95+ /usr/bin/env bash bin/setup
14196
14297 - run :
143- name : " Install ~/.bazelrc "
98+ name : " Bazel Buildifier Build "
14499 command : |
145- cp .circleci/.bazelrc ${HOME}
100+ bazel ${BAZEL_OPTS} build ${BAZEL_BUILD_OPTS} :buildifier-check
146101
147102 - run :
148- name : " Bazel Buildifier Check "
103+ name : " Bazel Buildifier Run "
149104 command : |
150- bazel ${BAZEL_OPTS} build ${BAZEL_BUILD_OPTS} :buildifier-check
151105 bazel ${BAZEL_OPTS} run ${BAZEL_BUILD_OPTS} :buildifier-check
152106
153107workflows :
154108 rules_ruby :
155109 jobs :
156- - ruby_style
157- - bazel_rules
158- - bazel_examples
159- - bazel_buildifier
110+ - bazel_build_workspace
111+ - bazel_build_examples
112+ - buildifier
0 commit comments