Skip to content

Commit 39f74f1

Browse files
authored
ci/local: Test macOS build (#507)
Signed-off-by: Ryan Northey <[email protected]>
1 parent 0a2c85d commit 39f74f1

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed

.github/workflows/macos-build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: macOS build
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
push:
9+
10+
11+
jobs:
12+
build:
13+
runs-on: macos-14
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- run: |
18+
brew install coreutils gnu-tar
19+
- run: |
20+
./build-website.sh

build-website.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,31 @@ set -o pipefail
44

55
BAZEL="${BAZEL:-bazel}"
66
OUTPUT_DIR="${1:-_site}"
7-
OUTPUT_DIR="$(realpath "${OUTPUT_DIR}")"
87
OUTPUT_BASE="$($BAZEL info output_base 2>/dev/null)"
98

109

10+
# X-platform implementaion of working `realpath`
11+
get_realpath() {
12+
if command -v realpath >/dev/null 2>&1; then
13+
realpath "$1" 2>/dev/null || echo "$(pwd)/$1"
14+
else
15+
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
16+
fi
17+
}
18+
19+
20+
OUTPUT_DIR="$(get_realpath "${OUTPUT_DIR}")"
21+
22+
23+
num_procs () {
24+
if command -v nproc >/dev/null 2>&1; then
25+
nproc
26+
else
27+
sysctl -n hw.ncpu
28+
fi
29+
}
30+
31+
1132
debug_jvm_fail () {
1233
RETURN_CODE="$?"
1334
echo "Bazel exited with error: ${RETURN_CODE}"
@@ -22,9 +43,10 @@ debug_jvm_fail () {
2243
return "$RETURN_CODE"
2344
}
2445

46+
2547
inject_ci_bazelrc () {
2648
{
27-
PROC_COUNT="$(nproc)"
49+
PROC_COUNT="$(num_procs)"
2850
PROCS=$((PROC_COUNT - 1))
2951
SPHINX_ARGS="-j 12 -v warn"
3052
echo "build:ci --action_env=SPHINX_RUNNER_ARGS=\"${SPHINX_ARGS}\""

versions.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ VERSIONS = {
3232
"envoy_toolshed": {
3333
"type": "github_archive",
3434
"repo": "envoyproxy/toolshed",
35-
"version": "0.2.2",
36-
"sha256": "443fe177aba0cef8c17b7a48905c925c67b09005b10dd70ff12cd9f729a72d51",
35+
"version": "0.2.3",
36+
"sha256": "4727b896c51fccaeda1210ef8b2da567b1964e3f4f888f6e0d2bdabd63cd61bc",
3737
"urls": ["https://github.com/{repo}/archive/bazel-v{version}.tar.gz"],
3838
"patch_args": ["-p1"],
3939
"strip_prefix": "toolshed-bazel-v{version}/bazel",

0 commit comments

Comments
 (0)