Skip to content

Commit 76cc10d

Browse files
Run Bazel build in Github Actions (#213)
As some clients rely on the Bazel build, add a workflow to verify at least one Bazel target (linux-x86). Also, perform some minor cleanup to comments and target branches in our workflow files.
1 parent 0502736 commit 76cc10d

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

.bazelversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
pull_request:
44
push:
55
branches:
6-
- master
76
- main
87

98
permissions:

.github/workflows/build_bazel.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build using Bazel
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
13+
cancel-in-progress: true
14+
jobs:
15+
bazel-linux-local:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 40
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Build
21+
run: scripts/local-bazel-build.sh

scripts/local-bazel-build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 Google LLC
3+
4+
set -e
5+
6+
BAZEL_ARGS=()
7+
8+
# Bazel-level configuration
9+
#
10+
# If editing these flags, make sure `local-build.sh` flags are updated.
11+
BAZEL_ARGS+=("-c=\"opt\"")
12+
BAZEL_ARGS+=("-copt=\"fpic\"")
13+
14+
# User-specified Bazel arguments go last to allow overridding defaults
15+
BAZEL_ARGS+=($@)
16+
17+
# Build all targets
18+
bazel build :all

scripts/local-build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ mkdir -p build/local
1313
CMAKE_ARGS=()
1414

1515
# CMake-level configuration
16+
#
17+
# If editing these flags, make sure `local-build-bazel.sh` flags are updated.
1618
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
1719
CMAKE_ARGS+=("-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
1820

@@ -22,7 +24,7 @@ then
2224
CMAKE_ARGS+=("-GNinja")
2325
fi
2426

25-
# Use-specified CMake arguments go last to allow overridding defaults
27+
# User-specified CMake arguments go last to allow overridding defaults
2628
CMAKE_ARGS+=($@)
2729

2830
cd build/local && cmake ../.. \

0 commit comments

Comments
 (0)