Skip to content

Commit ea3ee3a

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Add custom ops test to CI job
Summary: Add it to pull.yml for both linux and macos Reviewed By: JacobSzwejbka Differential Revision: D48408763 fbshipit-source-id: 0d929f8f140a29e75a983cd5cbe256f163a3ec19
1 parent 814414c commit ea3ee3a

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

.github/workflows/pull.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
bash .ci/scripts/test.sh
3232
3333
# Test custom ops
34-
bash examples/custom_ops/test_custom_ops.sh
34+
bash examples/custom_ops/test_custom_ops.sh buck2
3535
3636
buck-build-test-macos:
3737
name: buck-build-test-macos
@@ -49,6 +49,9 @@ jobs:
4949
5050
# Build and test Executorch
5151
bash .ci/scripts/test.sh
52+
53+
# Test custom ops
54+
bash examples/custom_ops/test_custom_ops.sh buck2
5255
popd
5356
5457
cmake-build-test-linux:
@@ -68,3 +71,24 @@ jobs:
6871
6972
# Build and test Executorch
7073
bash .ci/scripts/test-cmake.sh
74+
75+
# Build and test custom ops
76+
bash examples/custom_ops/test_custom_ops.sh cmake
77+
78+
cmake-build-test-macos:
79+
name: cmake-build-test-macos
80+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
81+
with:
82+
runner: macos-m1-12
83+
submodules: 'true'
84+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
85+
script: |
86+
WORKSPACE=$(pwd)
87+
88+
pushd "${WORKSPACE}/pytorch/executorch"
89+
# Setup MacOS dependencies as there is no Docker support on MacOS atm
90+
bash .ci/scripts/setup-macos.sh
91+
92+
# Build and test custom ops
93+
bash examples/custom_ops/test_custom_ops.sh cmake
94+
popd

examples/custom_ops/test_custom_ops.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,17 @@ test_cmake_custom_op_2() {
9999
cmake-out/executor_runner "--model_path=./${model_name}.pte"
100100
}
101101

102-
test_buck2_custom_op_1
103-
test_cmake_custom_op_1
104-
test_buck2_custom_op_2
105-
test_cmake_custom_op_2
102+
if [[ $1 == "cmake" ]];
103+
then
104+
test_cmake_custom_op_1
105+
test_cmake_custom_op_2
106+
elif [[ $1 == "buck2" ]];
107+
then
108+
test_buck2_custom_op_1
109+
test_buck2_custom_op_2
110+
else
111+
test_cmake_custom_op_1
112+
test_cmake_custom_op_2
113+
test_buck2_custom_op_1
114+
test_buck2_custom_op_2
115+
fi

0 commit comments

Comments
 (0)