Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build frameworks. #2413

Closed
wants to merge 1 commit into from
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
44 changes: 0 additions & 44 deletions .github/workflows/app-build.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Apple

on:
push:
branches:
- main
- release/*
pull_request:
paths:
- .ci/docker/**
- .github/workflows/app-build.yml
- install_requirements.sh
- backends/apple/**
- build/build_apple_frameworks.sh
- build/create_frameworks.sh
- build/test_ios_ci.sh
- examples/demo-apps/**
- extension/apple/**
- extension/module/**
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true

jobs:
test-demo-ios:
name: test-demo-ios
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
runner: macos-latest-xlarge
python-version: '3.11'
submodules: 'true'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
WORKSPACE=$(pwd)
pushd "${WORKSPACE}/pytorch/executorch"
BUILD_TOOL=cmake

.ci/scripts/setup-conda.sh

# Setup MacOS dependencies as there is no Docker support on MacOS atm
GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"

# Build and test iOS Demo App
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
build/test_ios_ci.sh

popd

build-frameworks-ios:
name: build-frameworks-ios
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
runner: macos-latest-xlarge
python-version: '3.11'
submodules: 'true'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
upload-artifact: executorch.zip
timeout: 90
script: |
WORKSPACE=$(pwd)
pushd "${WORKSPACE}/pytorch/executorch"
BUILD_TOOL=cmake
VERSION="0.1.0"
OUTPUT="executorch-${VERSION}"

.ci/scripts/setup-conda.sh

# Setup MacOS dependencies as there is no Docker support on MacOS atm
GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"

# Install CoreML Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/coreml/scripts/install_requirements.sh

# Install MPS Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/mps/install_requirements.sh

# Build iOS Frameworks
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
build/build_apple_frameworks.sh --output="${OUTPUT}" --coreml --mps --portable --xnnpack

# Bundle iOS Frameworks
cp LICENSE "${OUTPUT}"
zip -r "${RUNNER_TEMP}/artifacts/${OUTPUT}.zip" "${OUTPUT}"

popd
4 changes: 2 additions & 2 deletions build/build_apple_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ SOURCE_ROOT_DIR=""
OUTPUT="cmake-out"
MODE="Release"
TOOLCHAIN=""
BUCK2="/tmp/buck2"
BUCK2="buck2"
PYTHON=$(which python3)
FLATC=""
FLATC="flatc"
IOS_DEPLOYMENT_TARGET="17.0"
COREML=OFF
MPS=OFF
Expand Down
Loading