forked from najaeda/naja
-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (58 loc) · 2.59 KB
/
Copy pathmacos-bazel.yml
File metadata and controls
68 lines (58 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: macOS Bazel Build
# CMake is naja's primary build system (see macos-build.yml) -- this
# workflow keeps the Bazel side (MODULE.bazel, BUILD.bazel throughout
# the tree) validated as a smoke test rather than as CI's main gate. See
# CLAUDE.md's "Build systems: CMake (primary) + Bazel (validated smoke
# test)" section, and internal/bazel-migration-plan.md for the full
# history of how this was built out and why it's not CI's primary path.
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-26, macos-15]
steps:
- uses: actions/checkout@v7
# No `submodules: true` -- Bazel fetches naja-if/naja-verilog/slang
# itself (MODULE.bazel), doesn't use the thirdparty/ checkouts.
# dependency-sync-check.yml is what keeps these two build systems'
# pins from silently drifting apart.
- name: Install dependencies
# tomlplusplus here is for slang's *own* internal find_package()
# (bazel/thirdparty/slang_host_prefixes.bzl queries `brew --prefix
# tomlplusplus` for slang's CMAKE_PREFIX_PATH) -- unrelated to this
# repo's own @tomlplusplus (vendored via git_repository since
# libtomlplusplus-dev isn't apt-installable on Ubuntu; still needed
# here regardless of that).
run: |
brew install capnp tbb bison flex boost fmt tomlplusplus pkg-config
- name: Set Homebrew paths
# Xcode's own toolchain ships an ancient BSD bison/flex
# (/Applications/Xcode*/.../usr/bin) that otherwise shadows
# Homebrew's -- e.g. that bison doesn't understand GNU bison's
# -Wconflicts-sr flag (bazel/lefdef_bison.bzl,
# bazel/thirdparty/*/system_tool.bzl's `which("bison")` picks
# whichever comes first on PATH).
run: |
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
echo "/opt/homebrew/opt/flex/bin" >> $GITHUB_PATH
echo "/opt/homebrew/opt/bison/bin" >> $GITHUB_PATH
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-${{ matrix.os }}
repository-cache: true
- name: Build
# --jobs=auto: Bazel already parallelizes across all local cores by
# default (unlike make/CMake's default serial build) -- spelled out
# explicitly here for clarity/predictability rather than because
# it's functionally required.
run: bazel build //... --jobs=auto
- name: Test
run: bazel test //... --test_output=errors --jobs=auto