fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreRe-enable disabled windows jobs in CI (#1353)b22a6e14

0.8.0
11.1 KiB338 linesraw
1---
2aspects_flags: &aspects_flags
3  - "--config=rustfmt"
4  - "--config=clippy"
5default_linux_targets: &default_linux_targets
6  - "//..."
7  # TODO: Switch manual tag to platform constraint after bazel 4.0.
8  - "//test/versioned_dylib:versioned_dylib_test"
9default_macos_targets: &default_macos_targets
10  - "--"
11  - "//..."
12default_windows_targets: &default_windows_targets
13  - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
14  - "//..."
15  - "-//bindgen/..."
16  - "-//test/proto/..."
17  - "-//tools/rust_analyzer/..."
18crate_universe_vendor_example_targets: &crate_universe_vendor_example_targets
19  - "//vendor_external:crates_vendor"
20  - "//vendor_local_manifests:crates_vendor"
21  - "//vendor_local_pkgs:crates_vendor"
22  - "//vendor_remote_manifests:crates_vendor_manifests"
23  - "//vendor_remote_pkgs:crates_vendor_pkgs"
24tasks:
25  ubuntu2004:
26    build_targets: *default_linux_targets
27    test_targets: *default_linux_targets
28    coverage_targets: *default_linux_targets
29  rbe_ubuntu1604:
30    shell_commands:
31      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
32      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
33    build_targets:
34      - "//..."
35    test_targets:
36      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
37      - "//..."
38      - "//test/..."
39      - "-//test/conflicting_deps:conflicting_deps_test"
40  macos:
41    build_targets: *default_macos_targets
42    test_targets: *default_macos_targets
43    coverage_targets: *default_macos_targets
44    build_flags: *aspects_flags
45  windows:
46    build_flags:
47      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
48      - "--config=rustfmt"
49      - "--config=clippy"
50    build_targets: *default_windows_targets
51    test_targets: *default_windows_targets
52  ubuntu2004_with_aspects:
53    name: With Aspects
54    platform: ubuntu2004
55    build_targets: *default_linux_targets
56    test_targets: *default_linux_targets
57    build_flags: *aspects_flags
58  rbe_ubuntu1604_with_aspects:
59    name: With Aspects
60    platform: rbe_ubuntu1604
61    shell_commands:
62      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
63      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
64    build_targets: *default_linux_targets
65    test_targets:
66      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
67      - "..."
68      - "//test/..."
69      - "-//test/conflicting_deps:conflicting_deps_test"
70    build_flags: *aspects_flags
71  rbe_ubuntu1604_rolling_with_aspects:
72    name: RBE Rolling Bazel Version With Aspects
73    platform: rbe_ubuntu1604
74    shell_commands:
75      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
76      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
77    build_targets: *default_linux_targets
78    test_targets:
79      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
80      - "..."
81      - "//test/..."
82      - "-//test/conflicting_deps:conflicting_deps_test"
83    build_flags: *aspects_flags
84    soft_fail: yes
85    bazel: "rolling"
86  macos_with_aspects:
87    name: With Aspects
88    platform: macos
89    build_targets: *default_macos_targets
90    test_targets: *default_macos_targets
91    build_flags: *aspects_flags
92  macos_rolling_with_aspects:
93    name: "Macos Rolling Bazel Version With Aspects"
94    platform: macos
95    build_targets: *default_macos_targets
96    test_targets: *default_macos_targets
97    build_flags: *aspects_flags
98    soft_fail: yes
99    bazel: "rolling"
100  windows_with_aspects:
101    name: With Aspects
102    platform: windows
103    build_flags:
104      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
105      - "--config=rustfmt"
106      - "--config=clippy"
107    build_targets: *default_windows_targets
108    test_targets: *default_windows_targets
109  windows_rolling_with_aspects:
110    name: "Windows Rolling Bazel Version With Aspects"
111    platform: windows
112    build_flags:
113      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
114      - "--config=rustfmt"
115      - "--config=clippy"
116    build_targets: *default_windows_targets
117    test_targets: *default_windows_targets
118    soft_fail: yes
119    bazel: "rolling"
120  ubuntu2004_clang:
121    name: With Clang
122    platform: ubuntu2004
123    build_flags:
124      - "--config=rustfmt"
125      - "--config=clippy"
126      - "--repo_env=CC=clang"
127    build_targets: *default_linux_targets
128    test_targets: *default_linux_targets
129  ubuntu2004_clang_lld:
130    name: With Clang and LLD
131    platform: ubuntu2004
132    shell_commands:
133      - "sudo apt -y update && sudo apt -y install lld"
134    build_flags:
135      - "--config=rustfmt"
136      - "--config=clippy"
137      - "--repo_env=CC=clang"
138      - "--linkopt=-fuse-ld=lld"
139    build_targets: *default_linux_targets
140    test_targets: *default_linux_targets
141  ubuntu2004_rolling_clang:
142    name: Rolling Bazel Version With Clang
143    platform: ubuntu2004
144    build_flags:
145      - "--config=rustfmt"
146      - "--config=clippy"
147      - "--repo_env=CC=clang"
148    build_targets: *default_linux_targets
149    test_targets: *default_linux_targets
150    soft_fail: yes
151    bazel: "rolling"
152  ubuntu1804:
153    name: "Min Bazel Version"
154    bazel: "5.0.0"
155    platform: ubuntu1804
156    build_targets: *default_linux_targets
157    test_targets: *default_linux_targets
158  ubuntu1804_with_aspects:
159    name: "Min Bazel Version With Aspects"
160    bazel: "5.0.0"
161    platform: ubuntu1804
162    build_targets: *default_linux_targets
163    test_targets: *default_linux_targets
164    build_flags: *aspects_flags
165  ubuntu2004_rolling_with_aspects:
166    name: "Rolling Bazel Version With Aspects"
167    bazel: "rolling"
168    platform: ubuntu2004
169    soft_fail: yes
170    build_targets: *default_linux_targets
171    test_targets: *default_linux_targets
172    build_flags: *aspects_flags
173  linux_docs:
174    name: Docs
175    platform: ubuntu2004
176    working_directory: docs
177    build_targets:
178      - //...
179    run_targets:
180      - "//:test_docs"
181  clippy_failure:
182    name: Negative Clippy Tests
183    platform: ubuntu2004
184    run_targets:
185      - "//test/clippy:clippy_failure_test"
186  rustfmt_failure:
187    name: Negative Rustfmt Tests
188    platform: ubuntu2004
189    run_targets:
190      - "//test/rustfmt:test_runner"
191  rust_analyzer_tests:
192    name: Rust-Analyzer Tests
193    platform: ubuntu2004
194    run_targets:
195      - "//test/rust_analyzer:rust_analyzer_test"
196  ubuntu2004_examples:
197    name: Examples
198    platform: ubuntu2004
199    working_directory: examples
200    build_targets:
201      - "//..."
202    test_targets:
203      - "//..."
204    build_flags: *aspects_flags
205  ubuntu2004_examples_clang:
206    name: Examples with Clang
207    platform: ubuntu2004
208    working_directory: examples
209    build_flags:
210      - "--repo_env=CC=clang"
211    build_targets:
212      - "//..."
213    test_targets:
214      - "//..."
215    build_flags: *aspects_flags
216  ubuntu2004_examples_clang_lld:
217    name: Examples with Clang and LLD
218    platform: ubuntu2004
219    shell_commands:
220      - "sudo apt -y update && sudo apt -y install lld"
221    working_directory: examples
222    build_flags:
223      - "--repo_env=CC=clang"
224      - "--linkopt=-fuse-ld=lld"
225    build_targets:
226      - "//..."
227    test_targets:
228      - "//..."
229    build_flags: *aspects_flags
230  ubuntu2004_examples_rolling:
231    name: "Examples with Rolling Bazel Version"
232    platform: ubuntu2004
233    working_directory: examples
234    build_targets:
235      - "//..."
236    test_targets:
237      - "//..."
238    build_flags: *aspects_flags
239    soft_fail: yes
240  rbe_ubuntu1604_examples:
241    name: Examples
242    platform: rbe_ubuntu1604
243    working_directory: examples
244    rbe_examples_targets: &rbe_examples_targets
245      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
246      - "//..."
247      # TODO: This requires an updated `rules_foreign_cc`
248      - "-//sys/..."
249      # See https://github.com/bazelbuild/bazel/issues/9987
250      - "-//ffi/rust_calling_c:matrix_dylib_test"
251      # The bindgen rules currently do not work on RBE
252      # see: https://github.com/bazelbuild/rules_rust/issues/919
253      - "-//bindgen/..."
254    shell_commands:
255      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
256      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
257    build_targets: *rbe_examples_targets
258    test_targets: *rbe_examples_targets
259    build_flags: *aspects_flags
260  macos_examples:
261    name: Examples
262    platform: macos
263    working_directory: examples
264    build_targets:
265      - "//..."
266    test_targets:
267      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
268      - "//..."
269    build_flags: *aspects_flags
270  windows_examples:
271    name: Examples
272    platform: windows
273    working_directory: examples
274    build_flags:
275      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
276      - "--config=rustfmt"
277      - "--config=clippy"
278    windows_targets: &windows_targets
279      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
280      - "//..."
281      # The bindgen rules currently do not work on windows
282      # see: https://github.com/bazelbuild/rules_rust/issues/919
283      - "-//bindgen/..."
284      # The proto rules do not work on windows
285      - "-//proto/..."
286      # The wasm rules do not work on windows
287      - "-//wasm/..."
288    build_targets: *windows_targets
289    test_targets: *windows_targets
290  crate_universe_examples_ubuntu2004:
291    name: Crate Universe Examples
292    platform: ubuntu2004
293    working_directory: examples/crate_universe
294    run_targets: *crate_universe_vendor_example_targets
295    build_targets:
296      - "//..."
297    test_targets:
298      - "//..."
299    build_flags: *aspects_flags
300  crate_universe_rbe_ubuntu1604:
301    name: Crate Universe Examples
302    platform: rbe_ubuntu1604
303    working_directory: examples/crate_universe
304    shell_commands:
305      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
306      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
307    run_targets: *crate_universe_vendor_example_targets
308    build_targets:
309      - "//..."
310    test_targets:
311      - "//..."
312    build_flags: *aspects_flags
313  crate_universe_examples_macos:
314    name: Crate Universe Examples
315    platform: macos
316    working_directory: examples/crate_universe
317    run_targets: *crate_universe_vendor_example_targets
318    build_targets:
319      - "//..."
320    test_targets:
321      - "//..."
322    build_flags: *aspects_flags
323  crate_universe_examples_windows:
324    name: Crate Universe Examples
325    platform: windows
326    working_directory: examples/crate_universe
327    batch_commands:
328      - echo startup --windows_enable_symlinks >> user.bazelrc
329      - echo build --enable_runfiles >> user.bazelrc  # this is not enabled by default on windows and is necessary for the cargo build scripts
330    run_targets: *crate_universe_vendor_example_targets
331    build_flags: *aspects_flags
332    build_targets:
333      - "//..."
334    test_targets:
335      - "//..."
336buildifier:
337  version: latest
338  warnings: "all"