Skip to content

Setup CI

Setup CI #2

Workflow file for this run

name: Development CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
contents: read
checks: write
steps:
############ Setup ############
- name: Repo checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.77.0
components: clippy
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
token: ${{ secrets.GITHUB_TOKEN }}
############ Install executorch deps ############
- name: Install executorch deps
run: |
git clone --depth 1 --branch v0.2.1 https://github.com/pytorch/executorch.git
cd executorch
git submodule sync --recursive
git submodule update --init
./install_requirements.sh
working-directory: ${{ runner.temp }}
# TODO: check USE_ATEN_LIB=true/false
# - name: Build executorch
# run: |
# git clone --depth 1 --branch v0.2.1 https://github.com/pytorch/executorch.git
# cd executorch
# git submodule sync --recursive
# git submodule update --init backends/xnnpack/third-party/cpuinfo
# git submodule update --init backends/xnnpack/third-party/pthreadpool
# git submodule update --init third-party/prelude
# git submodule update --init third-party/gflags
# git submodule update --init third-party/googletest
# git submodule update --init third-party/flatbuffers
# git submodule update --init third-party/flatcc
# git submodule update --init backends/xnnpack/third-party/XNNPACK
# git submodule update --init backends/xnnpack/third-party/FXdiv
# git submodule update --init third-party/pytorch
# echo TODO ./install_requirements.sh
# mkdir cmake-out && cd cmake-out
# cmake \
# -DDEXECUTORCH_SELECT_OPS_LIST="aten::add.out" \
# -DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
# -DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=OFF \
# -DBUILD_EXECUTORCH_PORTABLE_OPS=ON \
# -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
# -DEXECUTORCH_ENABLE_PROGRAM_VERIFICATION=ON \
# -DEXECUTORCH_ENABLE_LOGGING=ON \
# ..
# cd ..
# cmake --build cmake-out -j5
# working-directory: ${{ runner.temp }}
############ Build executorch-rs ############
- name: Build
run: cargo build
############ Linters ############
# - name: Rust Clippy linter
# uses: auguwu/clippy-action@1.4.0
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
############ Tests ############
- name: Run Rust tests
run: cargo test