68 lines
2.3 KiB
YAML
68 lines
2.3 KiB
YAML
name: rust_api
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- "tools/**"
|
|
|
|
pull_request:
|
|
paths-ignore:
|
|
- "tools/**"
|
|
- "docs/**"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test_rust_api:
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Set up Python 3.7
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install latest nightly Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
components: rustfmt, clippy
|
|
- name: update
|
|
run: sudo apt update
|
|
- name: Install dependencies
|
|
run: sudo apt install llvm-dev libclang-dev clang git-lfs
|
|
- name: Install onnxruntime
|
|
run: |
|
|
wget https://github.com/microsoft/onnxruntime/releases/download/v1.8.1/onnxruntime-linux-x64-1.8.1.tgz
|
|
tar -zxvf onnxruntime-linux-x64-1.8.1.tgz
|
|
pushd onnxruntime-linux-x64-1.8.1
|
|
popd
|
|
- name: Install opencv
|
|
run: sudo apt-get install libopencv-dev
|
|
- name: Install mmdeploy with onnxruntime backend
|
|
run: |
|
|
mkdir -p build && pushd build
|
|
export LD_LIBRARY_PATH=/home/runner/work/mmdeploy/mmdeploy/ncnn/install/lib/:$LD_LIBRARY_PATH
|
|
cmake -DMMDEPLOY_BUILD_SDK=ON -DMMDEPLOY_BUILD_SDK_MONOLITHIC=ON -DMMDEPLOY_TARGET_BACKENDS=ort -DMMDEPLOY_CODEBASES=all -DONNXRUNTIME_DIR=~/work/mmdeploy/mmdeploy/onnxruntime-linux-x64-1.8.1 ..
|
|
make install
|
|
popd
|
|
- name: Clone rust-mmdeploy
|
|
run: git clone https://github.com/liu-mengyang/rust-mmdeploy
|
|
- name: Install converted models
|
|
run: git clone https://github.com/liu-mengyang/mmdeploy-converted-models --depth=1
|
|
- name: Test rustdemo
|
|
run: |
|
|
pushd rust-mmdeploy
|
|
export MMDEPLOY_DIR=/home/runner/work/mmdeploy/mmdeploy/build/install
|
|
export LD_LIBRARY_PATH=$MMDEPLOY_DIR/lib:$LD_LIBRARY_PATH
|
|
export ONNXRUNTIME_DIR=/home/runner/work/mmdeploy/mmdeploy/onnxruntime-linux-x64-1.8.1
|
|
export LD_LIBRARY_PATH=$ONNXRUNTIME_DIR/lib:$LD_LIBRARY_PATH
|
|
cargo build
|
|
sh ci_test.sh
|