blob: 58ef879c1b8adb2713d04bcd76dfe67db9f071fa [file] [log] [blame]
Philipp Schrader37fdbb62021-12-18 00:30:37 -08001load("@ci_configure//:ci.bzl", "RUNNING_IN_CI")
Philipp Schraderebb658f2022-09-17 17:31:09 -07002load("@pip_deps//:requirements.bzl", "entry_point")
Philipp Schrader37fdbb62021-12-18 00:30:37 -08003
Philipp Schrader773577f2021-12-17 23:45:39 -08004sh_binary(
5 name = "gofmt",
6 srcs = ["gofmt.sh"],
7 data = [
8 "@go_sdk//:bin/gofmt",
9 ],
10 deps = [
11 "@bazel_tools//tools/bash/runfiles",
12 ],
13)
14
15sh_binary(
Brian Silverman4e278082022-05-19 22:47:41 -070016 name = "rustfmt",
17 srcs = ["rustfmt.sh"],
18 data = [
Brian Silvermane84b0cf2022-08-13 19:36:21 -070019 "@rust__x86_64-unknown-linux-gnu_tools//:rustfmt",
Brian Silverman4e278082022-05-19 22:47:41 -070020 ],
21 deps = [
22 "@bazel_tools//tools/bash/runfiles",
23 ],
24)
25
26sh_binary(
Philipp Schradercc016b32021-12-30 08:59:58 -080027 name = "buildifier",
28 srcs = ["buildifier.sh"],
29 data = [
30 "@com_github_bazelbuild_buildtools//buildifier",
31 ],
32 target_compatible_with = ["@platforms//cpu:x86_64"],
33 deps = [
34 "@bazel_tools//tools/bash/runfiles",
35 ],
36)
37
38sh_binary(
Ravago Jones23dac942022-07-31 16:18:54 -070039 name = "yapf",
40 srcs = ["yapf.sh"],
41 data = [
Philipp Schraderebb658f2022-09-17 17:31:09 -070042 entry_point("yapf"),
Ravago Jones23dac942022-07-31 16:18:54 -070043 ],
44 deps = [
45 "@bazel_tools//tools/bash/runfiles",
46 ],
47)
48
49sh_binary(
Philipp Schraderace08842022-03-26 14:52:55 -070050 name = "prettier",
51 srcs = ["prettier.sh"],
52 data = [
53 "@npm//prettier/bin:prettier",
54 ],
55 target_compatible_with = ["@platforms//cpu:x86_64"],
56 deps = [
57 "@bazel_tools//tools/bash/runfiles",
58 ],
59)
60
61sh_binary(
Philipp Schrader773577f2021-12-17 23:45:39 -080062 name = "run-ci",
63 srcs = [
64 "run-ci.sh",
65 ],
66 data = [
Philipp Schradercc016b32021-12-30 08:59:58 -080067 ":buildifier",
Philipp Schrader773577f2021-12-17 23:45:39 -080068 ":gofmt",
Philipp Schraderace08842022-03-26 14:52:55 -070069 ":prettier",
Brian Silverman4e278082022-05-19 22:47:41 -070070 ":rustfmt",
Ravago Jones23dac942022-07-31 16:18:54 -070071 ":yapf",
Philipp Schrader37fdbb62021-12-18 00:30:37 -080072 "//:gazelle-runner",
Philipp Schraderd96d4cb2022-02-06 15:37:29 -080073 "//tools/go:mirror_go_repos",
Philipp Schrader37fdbb62021-12-18 00:30:37 -080074 "//tools/go:tweak_gazelle_go_deps",
Brian Silverman4e278082022-05-19 22:47:41 -070075 "//tools/rust:tweak_cargo_raze_output",
76 "@cargo_raze//:raze",
Philipp Schrader37fdbb62021-12-18 00:30:37 -080077 "@go_sdk//:bin/go",
Philipp Schrader773577f2021-12-17 23:45:39 -080078 ],
Philipp Schrader37fdbb62021-12-18 00:30:37 -080079 env = {
80 # Prevent CI errors like:
81 # failed to initialize build cache at
82 # /var/lib/buildkite-agent/.cache/go-build: permission denied
83 "RUNNING_IN_CI": "1" if RUNNING_IN_CI else "0",
84 },
Philipp Schradercc016b32021-12-30 08:59:58 -080085 target_compatible_with = ["@platforms//cpu:x86_64"],
Philipp Schrader773577f2021-12-17 23:45:39 -080086 deps = [
87 "@bazel_tools//tools/bash/runfiles",
88 ],
89)