Skip to content

Commit 94517f0

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Build frameworks. (#2413)
Summary: Pull Request resolved: #2413 bypass-github-export-checks Reviewed By: huydhn Differential Revision: D54791338 fbshipit-source-id: b89842e7689b5338b1b82f3c6cba2c809408fbe0
1 parent e98a7e0 commit 94517f0

File tree

3 files changed

+94
-46
lines changed

3 files changed

+94
-46
lines changed

.github/workflows/app-build.yml

-44
This file was deleted.

.github/workflows/apple.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Apple
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/*
8+
pull_request:
9+
paths:
10+
- .ci/docker/**
11+
- .github/workflows/app-build.yml
12+
- install_requirements.sh
13+
- backends/apple/**
14+
- build/build_apple_frameworks.sh
15+
- build/create_frameworks.sh
16+
- build/test_ios_ci.sh
17+
- examples/demo-apps/**
18+
- extension/apple/**
19+
- extension/module/**
20+
workflow_dispatch:
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
test-demo-ios:
28+
name: test-demo-ios
29+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
30+
with:
31+
runner: macos-latest-xlarge
32+
python-version: '3.11'
33+
submodules: 'true'
34+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
35+
timeout: 90
36+
script: |
37+
WORKSPACE=$(pwd)
38+
pushd "${WORKSPACE}/pytorch/executorch"
39+
BUILD_TOOL=cmake
40+
41+
.ci/scripts/setup-conda.sh
42+
43+
# Setup MacOS dependencies as there is no Docker support on MacOS atm
44+
GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
45+
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"
46+
47+
# Build and test iOS Demo App
48+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
49+
build/test_ios_ci.sh
50+
51+
popd
52+
53+
build-frameworks-ios:
54+
name: build-frameworks-ios
55+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
56+
with:
57+
runner: macos-latest-xlarge
58+
python-version: '3.11'
59+
submodules: 'true'
60+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
61+
upload-artifact: executorch.zip
62+
timeout: 90
63+
script: |
64+
WORKSPACE=$(pwd)
65+
pushd "${WORKSPACE}/pytorch/executorch"
66+
BUILD_TOOL=cmake
67+
VERSION="0.1.0"
68+
OUTPUT="executorch-${VERSION}"
69+
70+
.ci/scripts/setup-conda.sh
71+
72+
# Setup MacOS dependencies as there is no Docker support on MacOS atm
73+
GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
74+
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"
75+
76+
# Install CoreML Backend Requirements
77+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
78+
backends/apple/coreml/scripts/install_requirements.sh
79+
80+
# Install MPS Backend Requirements
81+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
82+
backends/apple/mps/install_requirements.sh
83+
84+
# Build iOS Frameworks
85+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
86+
build/build_apple_frameworks.sh --output="${OUTPUT}" --coreml --mps --portable --xnnpack
87+
88+
# Bundle iOS Frameworks
89+
cp LICENSE "${OUTPUT}"
90+
zip -r "${RUNNER_TEMP}/artifacts/${OUTPUT}.zip" "${OUTPUT}"
91+
92+
popd

build/build_apple_frameworks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ SOURCE_ROOT_DIR=""
1313
OUTPUT="cmake-out"
1414
MODE="Release"
1515
TOOLCHAIN=""
16-
BUCK2="/tmp/buck2"
16+
BUCK2="buck2"
1717
PYTHON=$(which python3)
18-
FLATC=""
18+
FLATC="flatc"
1919
IOS_DEPLOYMENT_TARGET="17.0"
2020
COREML=OFF
2121
MPS=OFF

0 commit comments

Comments
 (0)