Skip to content

Commit f76d01c

Browse files
committed
Add MacOS to CI
1 parent 11ef247 commit f76d01c

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-18.04
11+
strategy:
12+
matrix:
13+
os: [ubuntu-18.04, macos-10.15]
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
env:
18+
BAZEL_USE_CPP_ONLY_TOOLCHAIN: 1
1219

1320
steps:
1421
- uses: actions/checkout@v2
@@ -17,9 +24,9 @@ jobs:
1724
uses: actions/cache@v1
1825
with:
1926
path: .cache
20-
key: bazel-${{ github.sha }}
27+
key: bazel-${{ matrix.os }}-${{ github.sha }}
2128
restore-keys: |
22-
bazel-
29+
bazel-${{ matrix.os }}
2330
2431
- name: Configure Bazel
2532
run: |
@@ -30,7 +37,11 @@ jobs:
3037
- name: Install bazelisk
3138
run: |
3239
mkdir -p "${GITHUB_WORKSPACE}/bin"
33-
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-linux-amd64" -o "${GITHUB_WORKSPACE}/bin/bazel"
40+
if [[ ${{ matrix.os }} = macos* ]]; then
41+
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-darwin-amd64" -o "${GITHUB_WORKSPACE}/bin/bazel"
42+
else
43+
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-linux-amd64" -o "${GITHUB_WORKSPACE}/bin/bazel"
44+
fi
3445
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
3546
"${GITHUB_WORKSPACE}/bin/bazel" version
3647

WORKSPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ cc_library(
4141
srcs = glob(["*.c"]),
4242
hdrs = glob(["*.h"]),
4343
copts = ["-w"],
44+
# Work around `ld -rpath` error on MacOS.
45+
linkstatic = 1,
4446
)
4547
""",
4648
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",

0 commit comments

Comments
 (0)