Skip to content

Build macOS ARM (macOS11) #4

Build macOS ARM (macOS11)

Build macOS ARM (macOS11) #4

name: Build macOS ARM (macOS11)
on:
# Allows to run the workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build RADS lib on macOS ARM (macOS 11)
runs-on: self-hosted
env:
SYSTEM_VERSION_COMPAT: 0
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
arch -arm64 brew reinstall zlib
- name: Setup pyenv
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
MACOSX_DEPLOYMENT_TARGET: 11.0
PYTHON_CONFIGURE_OPTS: "--enable-framework"
CFLAGS: "-Wno-implicit-function-declaration"
LDFLAGS: "-L/usr/local/opt/zlib/lib"
CPPFLAGS: "-I/usr/local/opt/zlib/include"
PKG_CONFIG_PATH: "/usr/local/opt/zlib/lib/pkgconfig"
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: 3.8
command: pip3 install -U pip3 wheel setuptools
- name: Collect submodules
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Download ANTs
uses: robinraju/release-downloader@main
with:
repository: "raidionics/Raidionics-dependencies"
latest: true
fileName: "ANTsX-v2.4.3_macos_arm.tar.gz"
out-file-path: "downloads"
- name: Extract ANTs
run: |
cd ${{github.workspace}}/downloads/
tar -xzf ANTsX-v2.4.3_macos_arm.tar.gz -C ${{github.workspace}}/downloads/
mv ${{github.workspace}}/downloads/install ${{github.workspace}}/raidionicsrads/ANTs/
- name: Built wheel for MacOS ARM
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64
- name: Upload Python wheel
uses: actions/upload-artifact@v4
with:
name: Python wheel
path: ${{github.workspace}}/dist/raidionicsrads-*.whl
if-no-files-found: error
test:
needs: build
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: self-hosted
steps:
- name: Setup pyenv for Python ${{ matrix.python-version }}
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: ${{ matrix.python-version }}
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: "Python wheel"
- name: Install wheel
run: pip3 install --find-links=${{github.workspace}} --no-cache-dir --force-reinstall raidionicsrads-*
shell: bash
- name: Test CLI
run: python3 -m raidionicsrads --help
- name: Clone repo
uses: actions/checkout@v4
- name: Segmentation pipeline unit test
run: cd ${{github.workspace}}/tests && python3 segmentation_pipeline_test.py
- name: Reporting pipeline unit test
run: cd ${{github.workspace}}/tests && python3 reporting_pipeline_test.py
- name: Reporting pipeline with BrainGrid unit test
run: cd ${{github.workspace}}/tests && python3 reporting_pipeline_braingrid_test.py
- name: Registration pipeline unit test with Python backend
run: cd ${{github.workspace}}/tests && python3 registration_pipeline_test.py
# - name: Test with pytest
# run: |
# pip install pytest
# pytest --verbose tests/