Skip to content

Commit d807840

Browse files
authored
Merge pull request The-OpenROAD-Project#9569 from QuantamHD/macos-bazel
ci: Adds MacOS Bazel Builder
2 parents 23dfc67 + 79e5c86 commit d807840

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build on macOS
2+
on:
3+
push:
4+
branches:
5+
- master # Updated to strictly track master
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
Mac-Build:
11+
runs-on: macos-latest
12+
steps:
13+
- name: Setup xcode
14+
uses: maxim-lobanov/setup-xcode@v1
15+
with:
16+
xcode-version: latest-stable
17+
18+
- name: Check out repository code
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: 'recursive'
22+
23+
# 1. RESTORE: All jobs (PRs, manual runs, master) get to read the cache
24+
- name: Restore Bazel Disk Cache
25+
uses: actions/cache/restore@v4
26+
with:
27+
path: ~/.cache/bazel-disk-cache
28+
key: ${{ runner.os }}-bazel-${{ github.sha }}
29+
restore-keys: |
30+
${{ runner.os }}-bazel-
31+
32+
- name: Install Bazelisk
33+
run: brew install bazelisk
34+
35+
- name: Build OpenROAD
36+
run: |
37+
bazelisk build \
38+
--disk_cache=~/.cache/bazel-disk-cache \
39+
--experimental_disk_cache_gc_max_size=5G \
40+
--//:platform=gui //:openroad
41+
42+
# 2. SAVE: Only executes if this is a push/merge directly to the master branch
43+
- name: Save Bazel Disk Cache
44+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
45+
uses: actions/cache/save@v4
46+
with:
47+
path: ~/.cache/bazel-disk-cache
48+
key: ${{ runner.os }}-bazel-${{ github.sha }}

0 commit comments

Comments
 (0)