Build macOS ARM #27
This file contains 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: Build macOS ARM | |
on: | |
# Allows to run the workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build packages | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create environment and install python packages | |
run: | | |
cd ${{github.workspace}} | |
mkdir tmp | |
cd tmp | |
python3 -m virtualenv -p python3 venv --clear | |
source venv/bin/activate | |
python3 -m pip install wheel setuptools==69.5.1 | |
deactivate | |
- name: Install dependencies | |
run: | | |
cd ${{github.workspace}} | |
source tmp/venv/bin/activate | |
python3 -m pip install --upgrade pip | |
pip3 install ffmpeg | |
pip3 install matplotlib | |
pip install git+https://github.com/dbouget/raidionics_rads_lib.git@master | |
pip3 install -r assets/requirements.txt | |
pip install --force-reinstall --no-cache-dir pyside6 | |
pip install urllib3==1.26.6 | |
deactivate | |
- 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/ | |
mkdir ${{github.workspace}}/ANTs | |
mv ${{github.workspace}}/downloads/install ${{github.workspace}}/ANTs/ | |
- name: Integration tests | |
env: | |
DISPLAY: ':99.0' | |
run: | | |
cd ${{github.workspace}} | |
source tmp/venv/bin/activate | |
pip3 install pytest-qt pytest-cov | |
pytest --cov=gui --cov=utils ${{github.workspace}}/integration_tests | |
deactivate | |
- name: Build software | |
run: | | |
cd ${{github.workspace}} | |
source tmp/venv/bin/activate | |
pip3 install pyinstaller==5.13.2 | |
mkdir tmp_dependencies | |
pyinstaller --log-level INFO --noconfirm --clean assets/main_arm.spec | |
- name: Test executable | |
run: ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+ | |
shell: bash | |
- name: Test GUI startup | |
run: cd ${{github.workspace}}/tests && python3 software_launch_test.py | |
- name: Make installer | |
run: | | |
git clone https://github.com/dbouget/quickpkg.git | |
quickpkg/quickpkg dist/Raidionics.app --output Raidionics-1.3.0-macOS.pkg | |
cp -r Raidionics-1.3.0-macOS.pkg dist/Raidionics-1.3.0-macOS-arm64.pkg | |
- name: Upload package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Package | |
path: ${{github.workspace}}/dist/Raidionics-* | |
if-no-files-found: error | |
- name: Cleanup | |
if: always() | |
run: | | |
rm -rf ${{github.workspace}}/tmp/ |