Skip to content

Commit 37ad0e0

Browse files
committed
wip: run presubmit CI in github actions
experimenting to potentially move off of bazelci, due to various challenges. this is a 1:1 representation of the presubmit.yml as-is, meaning buildifier hasn't been updated from 6.4.0, xcode is still 16.2, and pins for doc_tests are still in place. updating buildifier and moving the stardoc/doc_tests pins should be done in a separate PR, and potentially xcode 16.3 as well (this would also allow us to more easily test a matrix of xcodes, if desired).
1 parent 535471c commit 37ad0e0

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.github/workflows/BUILD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
2+
3+
buildifier(
4+
name = "buildifier.check",
5+
exclude_patterns = ["./.git/*"],
6+
lint_mode = "warn",
7+
mode = "diff",
8+
)

.github/workflows/presubmit.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
push: ~
3+
pull_request: ~
4+
workflow_dispatch: ~
5+
6+
# NOTE: To avoid listing the same things for build_flags/test_flags for each
7+
# of these tasks, they are listed in the .bazelrc instead.
8+
jobs:
9+
macos:
10+
runs-on: macos-15
11+
strategy:
12+
matrix:
13+
bazel:
14+
- latest
15+
- last_rc
16+
- last_green
17+
env:
18+
USE_BAZEL_VERSION: ${{ matrix.bazel }}
19+
steps:
20+
- uses: bazel-contrib/[email protected]
21+
with:
22+
bazelisk-cache: true
23+
disk-cache: ${{ github.workflow }}
24+
repository-cache: true
25+
bazelrc: |
26+
test --test_tag_filters=-skipci
27+
- uses: maxim-lobanov/setup-xcode@v1
28+
with:
29+
xcode-version: '16.2'
30+
- uses: actions/checkout@v4
31+
- run: bazel build //tools/... //test/...
32+
- run: bazel test //tools/... //test/... //examples/...
33+
doc_tests:
34+
runs-on: ubuntu-latest
35+
env:
36+
# FIXME: Use last_green once we cherry-pick in changes needed by
37+
# https://github.com/bazelbuild/bazel/commit/b59004dd17366b09b0758b833f98294fd0e89345
38+
# USE_BAZEL_VERSION: last_green
39+
USE_BAZEL_VERSION: 21a12c72d84e9108142421d9a8526edf8dceb78c
40+
steps:
41+
- uses: bazel-contrib/[email protected]
42+
with:
43+
bazelisk-cache: true
44+
disk-cache: ${{ github.workflow }}
45+
repository-cache: true
46+
# TODO: Remove this once stardoc is updated to 0.7.1+ (https://github.com/bazelbuild/stardoc/pull/238)
47+
bazelrc: |
48+
test --noincompatible_disallow_empty_glob
49+
- uses: actions/checkout@v4
50+
- run: bazel test //doc/...
51+
buildifier:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: buildifier
56+
run: bazel run --enable_bzlmod //.github/workflows:buildifier.check

MODULE.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ bazel_dep(
2828
dev_dependency = True,
2929
repo_name = "com_google_protobuf",
3030
)
31+
bazel_dep(
32+
name = "buildifier_prebuilt",
33+
version = "7.1.2",
34+
dev_dependency = True,
35+
)
3136

3237
non_module_deps = use_extension("//apple:extensions.bzl", "non_module_deps")
3338
use_repo(

0 commit comments

Comments
 (0)