Skip to content

Commit

Permalink
Merge pull request #44 from qognitive/ci/macos
Browse files Browse the repository at this point in the history
[CI] Adding MacOS support
  • Loading branch information
jamesETsmith authored Oct 1, 2024
2 parents f0a393a + b3c7281 commit 7f05d12
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/all_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: python -m pip install numpy pytest cmake
run: python -m pip install cmake scikit-build-core
- name: Configure CMake
env:
CXX: ${{ matrix.compiler }}
Expand All @@ -31,7 +31,6 @@ jobs:
- name: Install
run: |
cmake --install ${{github.workspace}}/build
python -m pip install "scikit-build-core"
python -m pip install ".[dev]" --no-build-isolation
- name: Test C++
env:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/all_push_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: MacOS Build/Test
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14] # macos-14 is arm64, macos-13 is x86_64
compiler: [g++-12]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
# TODO: improve compiler setup for macos, right now we only use what's already on the github runners
# - name: Setup compiler
# run: python3 ./.github/compiler_setup.py ${{ matrix.compiler }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: python -m pip install cmake scikit-build-core
- name: Configure CMake
env:
CXX: ${{ matrix.compiler }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=${CXX}
- name: Build
run: |
cmake --build ${{github.workspace}}/build --verbose --parallel
- name: Install
run: |
cmake --install ${{github.workspace}}/build
python -m pip install ".[dev]" --no-build-isolation
- name: Test C++
env:
OMP_NUM_THREADS: 2
CPP_TEST_DIR: build/fast_pauli/cpp/tests
run: make test-cpp
- name: Test Python
run: make test-py
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<table>
<tr>
<td>Status</td>
<td><a href="https://github.com/qognitive/fast-pauli/actions/workflows/all_push.yml"><img src="https://github.com/qognitive/fast-pauli/actions/workflows/all_push.yml/badge.svg" alt="Build Status"></a>
<td><a href="https://github.com/qognitive/fast-pauli/actions/workflows/all_push.yml"><img src="https://github.com/qognitive/fast-pauli/actions/workflows/all_push.yml/badge.svg" alt="Linux Build Status"></a>
<a href="https://github.com/qognitive/fast-pauli/actions/workflows/all_push_macos.yml"><img src="https://github.com/qognitive/fast-pauli/actions/workflows/all_push_macos.yml/badge.svg" alt="MacOS Build Status"></a>
<a href="https://github.com/qognitive/fast-pauli/actions/workflows/pre-commit.yml"><img src="https://github.com/qognitive/fast-pauli/actions/workflows/pre-commit.yml/badge.svg" alt="Linting"></a>
</td>
</tr>
Expand All @@ -28,6 +29,7 @@
</table>



---
## Installation

Expand Down

0 comments on commit 7f05d12

Please sign in to comment.