forked from bazel-contrib/bazel-gazelle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpresubmit.yml
82 lines (81 loc) · 2.42 KB
/
presubmit.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
---
matrix:
platform:
- ubuntu2204
- macos
- windows
tasks:
ubuntu2204:
platform: ubuntu2204
build_targets:
- "..."
run_targets:
# Run Gazelle on repo to verify BUILD files are up-to-date. The output shouldn't differ
# between platforms, so we only run it from one.
- "//:gazelle_ci"
test_targets:
- "..."
bcr_tests:
name: BCR test module
platform: ${{ platform }}
working_directory: tests/bcr
shell_commands:
# Regenerate the BUILD file for the test module using Gazelle.
# Also verify -repo_config are generated correctly in gazelle.bash
- rm pkg/BUILD.bazel
- bazel run //:gazelle -- update pkg
- bazel run //:gazelle -- pkg
build_flags:
# Verify that the committed lockfile is platform-independent.
# In case of expected changes, regenerate the lockfile with
# `bazel mod graph`, which evaluates all module extensions.
# Note: `go_sdk`s *is* platform-dependent since it registers the first
# host-compatible SDK, but the result only differs if there is also a
# matching SDK with manual goos/goarch set, which isn't the case in CI.
# TODO: Make this more realistic after
# https://github.com/bazelbuild/bazel/issues/19154.
- "--lockfile_mode=error"
test_flags:
# See above.
- "--lockfile_mode=error"
build_targets:
- "//..."
- "//:gazelle"
test_targets:
# Specify this target explicitly to verify that Gazelle generated it correctly.
- "//pkg:pkg_test"
- "//..."
- "@test_dep//..."
macos_arm64:
platform: macos_arm64
build_targets:
- "..."
test_targets:
- "..."
macos:
platform: macos
build_targets:
- "..."
test_targets:
- "..."
windows:
platform: windows
build_targets:
- "--"
- "..."
- "-//cmd/autogazelle/..."
test_targets:
- "--"
- "..."
# autogazelle is only supported on UNIX-like platforms.
# It requires UNIX domain sockets.
- "-//cmd/autogazelle/..."
# Stardoc produces different line-endings on windows,
# so the documentation it generates doesn't match the checked in files
- "-//docs:all"
# Fails to execute, apparently due to command-line length limit.
- "-//internal:bazel_test"
# gazelle prints file paths with backward slashes on windows,
# which doesn't match the golden files generated on *nix.
- "-//tests:fix_mode_print0"
- "-//tests:fix_mode_strict"