Skip to content

Commit 5a3c1d8

Browse files
committed
Update dependencies
1 parent 4282481 commit 5a3c1d8

File tree

20 files changed

+589
-339
lines changed

20 files changed

+589
-339
lines changed

.bazelrc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
run --workspace_status_command="bash tools/workspace-status.sh"
2+
common --enable_platform_specific_config
3+
common --incompatible_enable_proto_toolchain_resolution
4+
common --protocopt=--fatal_warnings
25

3-
# absl requires compiling with C++14 or later, which the toolchain doesn't do by
4-
# default; host tooling (gRPC? protobuf?) requires absl.
5-
build --host_cxxopt=-std=c++17
6+
# Required to make protobuf compile on Windows
7+
common:windows --host_cxxopt=/std:c++17 --define=protobuf_allow_msvc=true
Lines changed: 98 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,35 @@
11
{
22
"jobs": {
33
"build_and_test": {
4-
"runs-on": "ubuntu-latest",
4+
"name": "build_and_test ${{ matrix.host.os }}",
5+
"runs-on": "${{ matrix.host.os }}",
56
"steps": [
67
{
78
"name": "Check out source code",
89
"uses": "actions/checkout@v1"
910
},
1011
{
1112
"name": "Installing Bazel",
12-
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-linux-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}"
13-
},
14-
{
15-
"name": "Bazel mod tidy",
16-
"run": "bazel mod tidy"
17-
},
18-
{
19-
"name": "Gazelle",
20-
"run": "rm -f $(find . -name '*.pb.go' | sed -e 's/[^/]*$/BUILD.bazel/') && bazel run //:gazelle"
21-
},
22-
{
23-
"name": "Buildifier",
24-
"run": "bazel run @com_github_bazelbuild_buildtools//:buildifier"
25-
},
26-
{
27-
"name": "Gofmt",
28-
"run": "bazel run @cc_mvdan_gofumpt//:gofumpt -- -w -extra $(pwd)"
29-
},
30-
{
31-
"name": "Clang format",
32-
"run": "find . -name '*.proto' -exec bazel run @llvm_toolchain_llvm//:bin/clang-format -- -i {} +"
13+
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-${{matrix.host.bazel_os}}-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}",
14+
"shell": "bash"
3315
},
3416
{
35-
"name": "GitHub workflows",
36-
"run": "bazel build //tools/github_workflows && cp bazel-bin/tools/github_workflows/*.yaml .github/workflows"
17+
"if": "matrix.host.platform_name == 'windows_amd64'",
18+
"name": "Override .bazelrc",
19+
"run": "echo \"startup --output_base=D:/bazel_output\" >> .bazelrc"
3720
},
3821
{
39-
"name": "Protobuf generation",
40-
"run": "if [ -d pkg/proto ]; then\n find . bazel-bin/pkg/proto -name '*.pb.go' -delete || true\n bazel build $(bazel query --output=label 'kind(\"go_proto_library\", //...)')\n find bazel-bin/pkg/proto -name '*.pb.go' | while read f; do\n cat $f > $(echo $f | sed -e 's|.*/pkg/proto/|pkg/proto/|')\n done\nfi\n"
41-
},
42-
{
43-
"name": "Embedded asset generation",
44-
"run": "bazel build $(git grep '^[[:space:]]*//go:embed ' | sed -e 's|\\(.*\\)/.*//go:embed |//\\1:|; s|\"||g; s| .*||' | sort -u)\ngit grep '^[[:space:]]*//go:embed ' | sed -e 's|\\(.*\\)/.*//go:embed |\\1/|' | while read o; do\n if [ -e \"bazel-bin/$o\" ]; then\n rm -rf \"$o\"\n cp -r \"bazel-bin/$o\" \"$o\"\n find \"$o\" -type f -exec chmod -x {} +\n fi\ndone\n"
45-
},
46-
{
47-
"name": "Test style conformance",
48-
"run": "git add . && git diff --exit-code HEAD --"
49-
},
50-
{
51-
"name": "Golint",
52-
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
53-
},
54-
{
55-
"name": "linux_amd64: build and test",
56-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64 //..."
22+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_amd64'",
23+
"name": "linux_amd64: build${{ matrix.host.platform_name == 'linux_amd64' && ' and test' || '' }}",
24+
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_amd64 //..."
5725
},
5826
{
27+
"if": "matrix.host.upload",
5928
"name": "linux_amd64: copy bb_remote_asset",
6029
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
6130
},
6231
{
32+
"if": "matrix.host.upload",
6333
"name": "linux_amd64: upload bb_remote_asset",
6434
"uses": "actions/upload-artifact@v4",
6535
"with": {
@@ -68,14 +38,17 @@
6838
}
6939
},
7040
{
71-
"name": "linux_386: build and test",
72-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..."
41+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_386'",
42+
"name": "linux_386: build${{ matrix.host.platform_name == 'linux_amd64' && ' and test' || '' }}",
43+
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_386 //..."
7344
},
7445
{
46+
"if": "matrix.host.upload",
7547
"name": "linux_386: copy bb_remote_asset",
7648
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_386 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
7749
},
7850
{
51+
"if": "matrix.host.upload",
7952
"name": "linux_386: upload bb_remote_asset",
8053
"uses": "actions/upload-artifact@v4",
8154
"with": {
@@ -84,14 +57,17 @@
8457
}
8558
},
8659
{
87-
"name": "linux_arm: build and test",
88-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
60+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm'",
61+
"name": "linux_arm: build${{ matrix.host.platform_name == 'linux_arm' && ' and test' || '' }}",
62+
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_arm //..."
8963
},
9064
{
65+
"if": "matrix.host.upload",
9166
"name": "linux_arm: copy bb_remote_asset",
9267
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
9368
},
9469
{
70+
"if": "matrix.host.upload",
9571
"name": "linux_arm: upload bb_remote_asset",
9672
"uses": "actions/upload-artifact@v4",
9773
"with": {
@@ -100,14 +76,17 @@
10076
}
10177
},
10278
{
103-
"name": "linux_arm64: build and test",
104-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
79+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm64'",
80+
"name": "linux_arm64: build${{ matrix.host.platform_name == 'linux_arm64' && ' and test' || '' }}",
81+
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_arm64 //..."
10582
},
10683
{
84+
"if": "matrix.host.upload",
10785
"name": "linux_arm64: copy bb_remote_asset",
10886
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
10987
},
11088
{
89+
"if": "matrix.host.upload",
11190
"name": "linux_arm64: upload bb_remote_asset",
11291
"uses": "actions/upload-artifact@v4",
11392
"with": {
@@ -116,14 +95,17 @@
11695
}
11796
},
11897
{
119-
"name": "darwin_amd64: build and test",
120-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
98+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_amd64'",
99+
"name": "darwin_amd64: build${{ matrix.host.platform_name == 'darwin_amd64' && ' and test' || '' }}",
100+
"run": "bazel ${{ matrix.host.platform_name == 'darwin_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
121101
},
122102
{
103+
"if": "matrix.host.upload",
123104
"name": "darwin_amd64: copy bb_remote_asset",
124105
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
125106
},
126107
{
108+
"if": "matrix.host.upload",
127109
"name": "darwin_amd64: upload bb_remote_asset",
128110
"uses": "actions/upload-artifact@v4",
129111
"with": {
@@ -132,14 +114,17 @@
132114
}
133115
},
134116
{
135-
"name": "darwin_arm64: build and test",
136-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
117+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_arm64'",
118+
"name": "darwin_arm64: build${{ matrix.host.platform_name == 'darwin_arm64' && ' and test' || '' }}",
119+
"run": "bazel ${{ matrix.host.platform_name == 'darwin_arm64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
137120
},
138121
{
122+
"if": "matrix.host.upload",
139123
"name": "darwin_arm64: copy bb_remote_asset",
140124
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
141125
},
142126
{
127+
"if": "matrix.host.upload",
143128
"name": "darwin_arm64: upload bb_remote_asset",
144129
"uses": "actions/upload-artifact@v4",
145130
"with": {
@@ -148,14 +133,17 @@
148133
}
149134
},
150135
{
151-
"name": "freebsd_amd64: build and test",
152-
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_remote_asset"
136+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'freebsd_amd64'",
137+
"name": "freebsd_amd64: build${{ matrix.host.platform_name == 'freebsd_amd64' && ' and test' || '' }}",
138+
"run": "bazel ${{ matrix.host.platform_name == 'freebsd_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:freebsd_amd64 //..."
153139
},
154140
{
141+
"if": "matrix.host.upload",
155142
"name": "freebsd_amd64: copy bb_remote_asset",
156143
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
157144
},
158145
{
146+
"if": "matrix.host.upload",
159147
"name": "freebsd_amd64: upload bb_remote_asset",
160148
"uses": "actions/upload-artifact@v4",
161149
"with": {
@@ -164,14 +152,17 @@
164152
}
165153
},
166154
{
167-
"name": "windows_amd64: build and test",
168-
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_remote_asset"
155+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'windows_amd64'",
156+
"name": "windows_amd64: build${{ matrix.host.platform_name == 'windows_amd64' && ' and test' || '' }}",
157+
"run": "bazel ${{ matrix.host.platform_name == 'windows_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:windows_amd64 //..."
169158
},
170159
{
160+
"if": "matrix.host.upload",
171161
"name": "windows_amd64: copy bb_remote_asset",
172162
"run": "rm -f bb_remote_asset.exe && bazel run --run_under cp --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset.exe"
173163
},
174164
{
165+
"if": "matrix.host.upload",
175166
"name": "windows_amd64: upload bb_remote_asset",
176167
"uses": "actions/upload-artifact@v4",
177168
"with": {
@@ -183,22 +174,70 @@
183174
"env": {
184175
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
185176
},
177+
"if": "matrix.host.upload",
186178
"name": "Install Docker credentials",
187179
"run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin"
188180
},
189181
{
182+
"if": "matrix.host.upload",
190183
"name": "Push container bb_remote_asset:bb_remote_asset",
191184
"run": "bazel run --stamp //cmd/bb_remote_asset:bb_remote_asset_container_push"
192185
}
186+
],
187+
"strategy": {
188+
"matrix": {
189+
"host": [
190+
{
191+
"bazel_os": "linux",
192+
"cross_compile": true,
193+
"os": "ubuntu-latest",
194+
"platform_name": "linux_amd64",
195+
"upload": true
196+
},
197+
{
198+
"bazel_os": "windows",
199+
"cross_compile": false,
200+
"os": "windows-latest",
201+
"platform_name": "windows_amd64",
202+
"upload": false
203+
}
204+
]
205+
}
206+
}
207+
},
208+
"lint": {
209+
"name": "lint",
210+
"runs-on": "ubuntu-latest",
211+
"steps": [
212+
{
213+
"name": "Check out source code",
214+
"uses": "actions/checkout@v1"
215+
},
216+
{
217+
"name": "Installing Bazel",
218+
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-linux-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}",
219+
"shell": "bash"
220+
},
221+
{
222+
"name": "Reformat",
223+
"run": "bazel run @com_github_buildbarn_bb_storage//tools:reformat"
224+
},
225+
{
226+
"name": "Test style conformance",
227+
"run": "git add . && git diff --exit-code HEAD --"
228+
},
229+
{
230+
"name": "Golint",
231+
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
232+
}
193233
]
194234
}
195235
},
196-
"name": "master",
236+
"name": "main",
197237
"on": {
198238
"push": {
199239
"branches": [
200-
"main",
201-
"master"
240+
"main"
202241
]
203242
}
204243
}

0 commit comments

Comments
 (0)