Skip to content
Closed
Show file tree
Hide file tree
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
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI Test

on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]

jobs:
test-apple-silicon:
name: Test on M1 Mac
runs-on: macos-14

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Build Dependencies
run: |
pip install --upgrade pip setuptools wheel cmake pybind11

- name: Build Backend (CMake)
run: |
mkdir build
cd build
cmake -Dpybind11_DIR=$(python -m pybind11 --cmakedir) ..
cmake --build .

- name: Install Library
# Installs your library in editable mode
run: pip install -e .

- name: Install Test Dependencies
run: pip install pytest

- name: Run Tests
run: |
pytest tests/
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ pybind11_add_module(
cpp/src/metal_utils.mm
)

if(APPLE)
find_library(METAL_LIB Metal)
find_library(MPS_LIB MetalPerformanceShaders)
find_library(FOUNDATION_LIB Foundation)

target_link_libraries(_backend PRIVATE
${METAL_LIB}
${MPS_LIB}
${FOUNDATION_LIB}
)
endif()

# Put output in python package
set_target_properties(_backend PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/py/Forge
Expand Down
Loading