Skip to content

Commit

Permalink
Build frameworks. (#2413)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2413

bypass-github-export-checks

Reviewed By: huydhn

Differential Revision: D54791338

fbshipit-source-id: b89842e7689b5338b1b82f3c6cba2c809408fbe0
  • Loading branch information
shoumikhin authored and facebook-github-bot committed Mar 14, 2024
1 parent e98a7e0 commit 94517f0
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 46 deletions.
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

0 comments on commit 94517f0

Please sign in to comment.