Skip to content

Commit a838685

Browse files
committed
Added CI tests
1 parent be9c771 commit a838685

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.ci/scripts/setup-emscripten.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11

22
set -ex
33

4+
# need version >= 17
5+
install_node() {
6+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
7+
source "$HOME/.nvm/nvm.sh"
8+
nvm install 22
9+
}
10+
411
install_emscripten() {
512
git clone https://github.com/emscripten-core/emsdk.git
613
pushd emsdk || return
@@ -10,4 +17,5 @@ install_emscripten() {
1017
popd || return
1118
}
1219

20+
install_node
1321
install_emscripten

.github/workflows/pull.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,41 @@ jobs:
763763
# Test selective build
764764
PYTHON_EXECUTABLE=python bash examples/wasm/test_build_wasm.sh
765765
766+
unittest-wasm-bindings:
767+
name: unittest-wasm-bindings
768+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
769+
permissions:
770+
id-token: write
771+
contents: read
772+
strategy:
773+
fail-fast: false
774+
with:
775+
runner: linux.2xlarge
776+
docker-image: executorch-ubuntu-22.04-clang12
777+
submodules: 'recursive'
778+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
779+
timeout: 90
780+
script: |
781+
# The generic Linux job chooses to use base env, not the one setup by the image
782+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
783+
conda activate "${CONDA_ENV}"
784+
785+
BUILD_TOOL="cmake"
786+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
787+
788+
# Install Node.js and Emscripten
789+
source .ci/scripts/setup-emscripten.sh
790+
791+
# Test selective build
792+
scripts/build_wasm_tests.sh
793+
794+
# Install Jest
795+
cd cmake-out-wasm/extension/wasm/test
796+
npm install --save-dev jest
797+
798+
# Run unit test
799+
npm test
800+
766801
unittest-nxp-neutron:
767802
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
768803
permissions:
@@ -791,8 +826,8 @@ jobs:
791826
792827
# Run pytest
793828
PYTHON_EXECUTABLE=python bash backends/nxp/run_unittests.sh
794-
795-
# Run aot example:
829+
830+
# Run aot example:
796831
PYTHON_EXECUTABLE=python bash examples/nxp/run_aot_example.sh
797832
798833

0 commit comments

Comments
 (0)