Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mac build #18

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

name: CI MacOS

on:
workflow_dispatch:

jobs:

mac:

strategy:
matrix:
py-version: ['3.10']
fail-fast: false
name: Python ${{ matrix.py-version }}

runs-on: macos-latest
timeout-minutes: 180
env:
MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe"
PYNUCLEUS_BUILD_PARALLELISM: 3
SUITESPARSE_INCLUDE_DIR: /usr/local/Cellar/brewsci-suite-sparse/4.5.5_2/include
SUITESPARSE_LIBRARY_DIR: /usr/local/Cellar/brewsci-suite-sparse/4.5.5_2/lib
LDFLAGS: -L/usr/local/opt/brewsci-metis/lib -L/usr/local/opt/brewsci-parmetis/lib
CPPFLAGS: -I/usr/local/opt/brewsci-metis/include -I/usr/local/opt/brewsci-parmetis/include

steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Pull ccache cache
if: always()
id: ccache-restore
uses: actions/cache/restore@v3
with:
path: /home/runner/.cache/ccache
key: ccache-mac-${{ matrix.py-version }}

- name: Setup GNU Fortran
uses: modflowpy/install-gfortran-action@v1

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py-version }}

- name: Install packages
run: |
brew install open-mpi ccache
brew tap brewsci/num
brew install brewsci-metis brewsci-parmetis brewsci-suite-sparse

- name: Get ccache config dir
if: always()
run: ccache --show-config

- name: Install Python dependencies
run: make prereq && make prereq-extra

- name: Install
run: make install

- name: Remove ccache cache
if: ${{ steps.ccache-restore.outputs.cache-hit }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ccache-mac-${{ matrix.py-version }} --confirm
continue-on-error: true

- name: Push ccache cache
if: always()
uses: actions/cache/save@v3
with:
path: /home/runner/.cache/ccache
key: ccache-mac-${{ matrix.py-version }}

- name: Ccache report
if: always()
run: ccache -s

- name: Run tests
if: always()
run: python3 -m pytest --junit-xml=test-results-mac-${{ matrix.py-version }}.xml -k "testFractional[interval-const0.75-knownSolution-P1-cg-mg-H2" tests/
Loading