Skip to content

Commit b5c9433

Browse files
committed
CI: update macOS workflow
- Add Python 3.12 scripts to path (colcon is installed with Python 3.12). - Rename workflows to include macOS version number. - Add workflows for macOS Ventura and Sonoma. - Remove workflow for macOS Sonoma. - Update dependencies. - Suppress colcon desktop notification error. Signed-off-by: Rhys Mainwaring <[email protected]>
1 parent 727a506 commit b5c9433

File tree

7 files changed

+104
-5
lines changed

7 files changed

+104
-5
lines changed

.github/scripts/brew_install_deps.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,33 @@ do
5151
brew link $DEP_PKG
5252
done
5353
done
54+
55+
56+
# keg only packages to install - only link dependencies
57+
PKGS_KEG_ONLY=(
58+
59+
)
60+
61+
# install packages
62+
for PKG in "${PKGS_KEG_ONLY[@]}"
63+
do
64+
brew install ${PKG}
65+
done
66+
67+
# The GitHub actions cache does restore links, so we force
68+
# (re-)linking on all dependencies of packages we install.
69+
70+
for PKG in "${PKGS_KEG_ONLY[@]}"
71+
do
72+
# keg only do not link package
73+
74+
DEPS=$(brew deps ${PKG})
75+
declare -a DEPS_ARRAY
76+
DEPS_ARRAY=(${DEPS})
77+
78+
for DEP_PKG in "${DEPS_ARRAY[@]}"
79+
do
80+
# link package dependencies
81+
brew link $DEP_PKG
82+
done
83+
done

.github/scripts/macos_build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/opt/[email protected]/lib/pkgc
1111
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/qt@5
1212

1313
# Python scripts installed with: `pip3 install --user <package>`
14-
export PATH=$PATH:$HOME/Library/Python/3.11/bin
14+
export PATH=$PATH:$HOME/Library/Python/3.11/bin:$HOME/Library/Python/3.12/bin
1515

16-
colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib
16+
# Use desktop_notification- to suppress error:
17+
# ERROR:colcon.colcon_notification.desktop_notification.terminal_notifier:
18+
# Could not find the colcon-terminal-notifier.app in the install prefix '/Users/runner/Library/Python/3.12'
19+
colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib --event-handlers desktop_notification-

.github/scripts/macos_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Python scripts installed with: `pip3 install --user <package>`
4-
export PATH=$PATH:$HOME/Library/Python/3.11/bin
4+
export PATH=$PATH:$HOME/Library/Python/3.11/bin:$HOME/Library/Python/3.12/bin
55

66
colcon test --merge-install
77
colcon test-result --all --verbose

.github/workflows/macos-monterey-build-tools.yml renamed to .github/workflows/macos12-monterey-build-tools.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: macOS Monterey Build Tools
22

3-
on: [push, pull_request]
3+
on: [pull_request]
44

55
jobs:
66
macos-monterey-ci:
@@ -20,5 +20,5 @@ jobs:
2020
which pip3
2121
which python3
2222
python3 --version
23-
export PATH=$PATH:/Users/runner/Library/Python/3.11/bin
23+
export PATH=$PATH:/Users/runner/Library/Python/3.11/bin:/Users/runner/Library/Python/3.12/bin
2424
colcon graph
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: macOS Ventura Build Tools
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
macos-ventura-ci:
7+
runs-on: macos-13
8+
name: macOS Ventura Build Tools
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- name: Install Build Tools
14+
run: |
15+
pip3 install --user vcstool
16+
pip3 install --user colcon-common-extensions
17+
18+
- name: Check Build Tools
19+
run: |
20+
which pip3
21+
which python3
22+
python3 --version
23+
export PATH=$PATH:/Users/runner/Library/Python/3.11/bin:/Users/runner/Library/Python/3.12/bin
24+
colcon graph
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: macOS Ventura CI
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
macos-ventura-ci:
7+
runs-on: macos-13
8+
name: macOS Ventura CI
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- name: Cache brew packages
14+
id: cache-brew-packages
15+
uses: actions/cache@v3
16+
with:
17+
path: |
18+
/usr/local/Cellar
19+
/usr/local/Frameworks
20+
/usr/local/Homebrew
21+
/usr/local/bin
22+
/usr/local/lib
23+
/usr/local/opt
24+
/usr/local/share
25+
key: macos-build-cache-${{ hashFiles('./.github/scripts/brew_install_deps.sh') }}
26+
27+
- name: Install brew packages
28+
run: |
29+
bash ./.github/scripts/brew_install_deps.sh
30+
31+
- name: Install Build Tools
32+
run: |
33+
python3 -m pip install --user vcstool
34+
python3 -m pip install --user colcon-common-extensions
35+
36+
- name: Build Wave Sim
37+
run: |
38+
bash ./.github/scripts/macos_build.sh
39+
40+
- name: Test Wave Sim
41+
run: |
42+
bash ./.github/scripts/macos_test.sh

0 commit comments

Comments
 (0)