Skip to content

Commit 6cf7709

Browse files
authored
Merge pull request #124 from OPENSPHERE-Inc/fix/macos-cmake-install
improve: CI build performance for macos
2 parents d43b363 + 890f6a4 commit 6cf7709

3 files changed

Lines changed: 24 additions & 10 deletions

File tree

.github/scripts/utils.zsh/check_macos

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,5 @@ if (( ! ${+commands[brew]} )) {
1919

2020
brew bundle --file ${SCRIPT_HOME}/.Brewfile
2121

22-
# Install specific cmake version
23-
local cmake_version=$(cmake --version 2>/dev/null | grep -o '3.31.6')
24-
if [[ ! "${cmake_version}" ]]; then
25-
brew unlink cmake
26-
brew tap-new local/tap
27-
brew extract cmake local/tap --version 3.31.6
28-
brew install local/tap/cmake@3.31.6
29-
fi
30-
3122
rehash
3223
log_group

.github/workflows/build-project.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,29 @@ jobs:
108108
print "pluginName=${product_name}" >> $GITHUB_OUTPUT
109109
print "pluginVersion=${product_version}" >> $GITHUB_OUTPUT
110110
111+
- name: Restore CMake Cache ♻️
112+
uses: actions/cache@v4
113+
id: cmake-cache
114+
with:
115+
path: /opt/cmake
116+
key: macos-cmake-3.31.6
117+
118+
- name: Install CMake 3.31.6 🔨
119+
if: steps.cmake-cache.outputs.cache-hit != 'true'
120+
shell: zsh --no-rcs --errexit --pipefail {0}
121+
run: |
122+
: Install CMake 3.31.6 🔨
123+
curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-macos-universal.tar.gz -o cmake.tar.gz
124+
sudo mkdir -p /opt/cmake
125+
sudo tar xzf cmake.tar.gz --strip-components=1 -C /opt/cmake
126+
rm cmake.tar.gz
127+
128+
- name: Add CMake to PATH 🛤️
129+
shell: zsh --no-rcs --errexit --pipefail {0}
130+
run: |
131+
: Add CMake to PATH 🛤️
132+
print "/opt/cmake/CMake.app/Contents/bin" >> $GITHUB_PATH
133+
111134
- uses: actions/cache@v4
112135
id: ccache-cache
113136
with:

.github/workflows/pr-pull.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
paths-ignore:
77
- '**.md'
8-
branches: [master, main]
8+
branches: [master, main, dev]
99
types: [ opened, synchronize, reopened ]
1010
permissions:
1111
contents: read

0 commit comments

Comments
 (0)