-
Notifications
You must be signed in to change notification settings - Fork 98
73 lines (68 loc) · 2.26 KB
/
macos.yml
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
69
70
71
72
73
name: macOS latest
on: [push, pull_request]
jobs:
build:
env:
PACKAGE: sdformat14
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew config
- run: brew list
# Workaround for https://github.com/actions/setup-python/issues/577
- name: Clean up python binaries
run: |
rm -f $(brew --prefix)/bin/2to3*;
rm -f $(brew --prefix)/bin/idle3*;
rm -f $(brew --prefix)/bin/pydoc3*;
rm -f $(brew --prefix)/bin/python3*;
rm -f $(brew --prefix)/bin/python3*-config;
- name: Install base dependencies
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew tap osrf/simulation;
# check for ci_matching_branch
brew install wget
wget https://github.com/gazebo-tooling/release-tools/raw/master/jenkins-scripts/tools/detect_ci_matching_branch.py
TRY_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
if python3 detect_ci_matching_branch.py ${TRY_BRANCH}
then
echo "# BEGIN SECTION: trying to checkout branch ${TRY_BRANCH} from osrf/simulation"
pushd $(brew --repo osrf/simulation)
git fetch origin ${TRY_BRANCH} || true
git checkout ${TRY_BRANCH} || true
popd
echo '# END SECTION'
fi
# gz-math7 has problems with swig, remove it for now
brew remove swig || true
brew install --only-dependencies ${PACKAGE};
- run: mkdir build
- name: cmake
working-directory: build
run: |
export PYTHONPATH=$PYTHONPATH:$(brew --prefix)/lib/python
cmake .. -DCMAKE_INSTALL_PREFIX=$(brew --prefix)/Cellar/${PACKAGE}/HEAD -DPython3_EXECUTABLE=$(brew --prefix python3)/bin/python3
- run: make
working-directory: build
- run: make test
working-directory: build
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: make install
working-directory: build
run: |
make install;
brew link ${PACKAGE};
- name: Compile example code
working-directory: examples
run: |
mkdir build;
cd build;
cmake ..;
make;
./simple ../simple.sdf;