Skip to content

Fix macOS workflow (partial backport of #1367) #7254

Fix macOS workflow (partial backport of #1367)

Fix macOS workflow (partial backport of #1367) #7254

Workflow file for this run

name: macOS latest
on: [push, pull_request]
jobs:
build:
env:
PACKAGE: sdformat12
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
# 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;
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)/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;