Skip to content

Commit

Permalink
Use github actions macos-14 arm64 runner [skip cirrus]
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Feb 16, 2024
1 parent bb4960f commit 1663b9b
Showing 1 changed file with 40 additions and 13 deletions.
53 changes: 40 additions & 13 deletions .github/workflows/build-macos-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ on:

jobs:
build:
runs-on: macos-11
runs-on: ${{ matrix.os }}
timeout-minutes: 50
env:
REPO: https://github.com/biolab/orange3.git
BUILD_BRANCH: master
BUILD_COMMIT: FETCH_HEAD
BUILD_LOCAL: 1
APP: "/Applications/Orange3.app"

PYTHONFAULTHANDLER: 1
PIP_NO_PIP_VERSION_CHECK: 1
PIP_CACHE_DIR: .pip-cache
Expand All @@ -29,7 +27,16 @@ jobs:
fail-fast: False
matrix:
include:
- python-version: "3.10.11"
- os: macos-11
arch: x86_64
python-version: "3.10.11"
req: ../specs/macos/requirements.txt
app: "/Applications/Orange3.app"
- os: macos-14
arch: arm64
python-version: "3.10.11"
req: ../specs/macos/requirements-arm64.txt
app: "/Applications/Orange.app"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -101,52 +108,72 @@ jobs:
shell: bash
env:
PYTHON_VERSION: ${{ matrix.python-version }}
REQ: ${{ matrix.req }}
APP: ${{ matrix.app }}
run: |
set -e
cd orange3
if [[ $BUILD_LOCAL ]]; then
PIP_ARGS=( --pip-arg={-r,../specs/macos/requirements.txt,./} );
PIP_ARGS=( --pip-arg={-r,$REQ,./} );
else
PIP_ARGS=( --pip-arg={-r,../specs/macos/requirements.txt,Orange3==$BUILD_COMMIT} );
PIP_ARGS=( --pip-arg={-r,$REQ,Orange3==$BUILD_COMMIT} );
fi
../scripts/macos/build-macos-app.sh "${PIP_ARGS[@]}" --python-version=${PYTHON_VERSION} "$APP"
../scripts/macos/build-macos-app.sh --macos 11 "${PIP_ARGS[@]}" --python-version=${PYTHON_VERSION} "$APP"
- name: Apply arm64 specific patches
env:
APP: ${{ matrix.app }}
if: matrix.arch == "arm64"
run: |
patch -p1 -d "$APP" < ./scripts/macos/arm64.patch
- name: Build dmg installer
shell: bash
env:
PYTHON_VERSION: ${{ matrix.python-version }}
ARCH: ${{ matrix.arch }}
APP: ${{ matrix.app }}
run: |
set -e
mkdir dist
./scripts/macos/create-dmg-installer.sh --app "$APP" dist/Orange3.dmg
VERSION=$("$APP/Contents/MacOS/pip" show orange3 | grep -E '^Version: ' | cut -d ' ' -f 2)
mv dist/Orange3.dmg dist/Orange3-$VERSION-Python${PYTHON_VERSION}.dmg
shasum -a 256 dist/Orange3-$VERSION-Python${PYTHON_VERSION}.dmg
mv dist/Orange3.dmg dist/Orange3-$VERSION-Python${PYTHON_VERSION}-${ARCH}.dmg
shasum -a 256 dist/Orange3-$VERSION-Python${PYTHON_VERSION}-${ARCH}.dmg
- name: Upload dmg
uses: actions/upload-artifact@v4
with:
name: orange-dmg-installer
name: orange-dmg-installer-${{ matrix.arch }}
path: dist/Orange3-*.dmg
if-no-files-found: error

test:
name: Test
needs: build
runs-on: macos-latest
strategy:
fail-fast: False
matrix:
# Repeat of above build step runner definitions
include:
- os: macos-latest
arch: x86_64
- os: macos-14
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Download dmg
uses: actions/download-artifact@v4
with:
name: orange-dmg-installer
name: orange-dmg-installer-${{ matrix.arch }}
- name: Mount
shell: bash
run: |
mkdir ./mnt
hdiutil attach Orange3*.dmg -noverify -noautoopen -mountpoint ./mnt
- name: Run tests
run: |
APP=( mnt/Orange3.app )
APP=( mnt/Orange*.app )
$APP/Contents/MacOS/python --version
$APP/Contents/MacOS/pip --version
$APP/Contents/MacOS/pip freeze
Expand Down

0 comments on commit 1663b9b

Please sign in to comment.