Fixing macos CI #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: pomdp-py repo macOS build | |
| on: | |
| push: | |
| branches: [ main, dev-latest ] | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - labeled | |
| - unlabeled | |
| - ready_for_review | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Build dependencies | |
| shell: bash | |
| run: | | |
| # pomdp-solve (native, via autotools) | |
| mkdir -p thirdparty | |
| curl -L https://www.pomdp.org/code/pomdp-solve-5.5.tar.gz -o thirdparty/pomdp-solve-5.5.tar.gz | |
| tar -xzf thirdparty/pomdp-solve-5.5.tar.gz -C thirdparty | |
| mv thirdparty/pomdp-solve-5.5 thirdparty/pomdp-solve | |
| ( cd thirdparty/pomdp-solve && ./configure ) | |
| make -C thirdparty/pomdp-solve/src | |
| ln -sf "$(pwd)/thirdparty/pomdp-solve/src/pomdp-solve" thirdparty/pomdp-solve.bin | |
| # APPL / SARSOP (strip x86-only flags on arm64) | |
| git clone https://github.com/personalrobotics/appl.git thirdparty/appl | |
| git -C thirdparty/appl apply ../../tests/appl.patch | |
| if [[ $(uname -m) == "arm64" ]]; then | |
| find thirdparty/appl/src -name "Makefile*" -print0 \ | |
| | xargs -0 sed -i '' -E 's/ -m(sse|sse2|ssse3|sse4[^ ]*)//g; s/ -mfpmath=sse//g; s/ -march=[^ ]+//g; s/ -mtune=[^ ]+//g' | |
| fi | |
| make -C thirdparty/appl/src | |
| make -C thirdparty/appl/src install | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Test | |
| run: | | |
| export POMDP_SOLVE_PATH=./thirdparty/pomdp-solve.bin | |
| export POMDPSOL_PATH=./thirdparty/appl/bin/pomdpsol | |
| export POMDPCONVERT_PATH=./thirdparty/appl/src/pomdpconvert | |
| python tests/test_all.py |