Skip to content

Commit

Permalink
Add CI for Mirror branch
Browse files Browse the repository at this point in the history
  • Loading branch information
taoboyang committed Nov 16, 2023
1 parent a04ec70 commit ed8cec5
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .codebase/pipelines/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: UNITTEST CI
trigger:
change:
branches: [BabitMF_mirror]
jobs:
py3_build_test:
name: build_test
image: ubuntu:22.04
steps:
- uses: actions/setup-proxy
- name: prepare libraries
commands:
- export DEBIAN_FRONTEND=noninteractive
- apt update
- apt install -y make git pkg-config libssl-dev cmake binutils-dev libgoogle-glog-dev gcc g++ golang wget libgl1 python3 python3-pip
- python3 -m pip install timeout_decorator numpy onnxruntime pytest opencv-python
# The version of ffmpeg installed via apt is 4.2, but the current test results are based on version 4.4, so here we need to compile version 4.4 of ffmpeg from source code
#apt install -y ffmpeg libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavresample-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev
# When running unit tests, nasm/yasm installed via apt will cause the indicators to be misaligned, so it needs to be compiled from source code
#apt install -y nasm yasm
- scripts/build_ffmpeg.sh nasm yasm x264 x265 opus
- name: build_env
commands:
# unit test
- git submodule update --init --recursive
- ./build.sh
- apt-get update
- apt-get install -y protobuf-compiler libgflags-dev libdw-dev libgoogle-glog-dev
- pip3 install --upgrade pip
- pip3 install timeout_decorator onnxruntime requests opencv-python
- echo "build finished"
- name: run_test
commands:
- export C_INCLUDE_PATH=${C_INCLUDE_PATH}:$(pwd)/output/bmf/include
- export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:$(pwd)/output/bmf/include
- export LIBRARY_PATH=${LIBRARY_PATH}:$(pwd)/output/bmf/lib
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/output/bmf/lib:/usr/local/lib
- export PYTHONPATH=$(pwd)/output/bmf/lib:$(pwd)/output
- export PATH=${PATH}:$(pwd)/output/bmf/bin
- export HMP_TEST_DATA_ROOT=$(pwd)/bmf/hml/tests/data
- $(pwd)/output/bmf/bin/module_manager install python_copy_module python my_module:my_module $(pwd)/output/test/customize_module v0.0.1
- $(pwd)/output/bmf/bin/module_manager install cpp_copy_module c++ libcopy_module:CopyModule $(pwd)/output/test/c_module/lib v0.0.1
- (cd $(pwd)/output/test/go_module && go build -buildmode c-shared -o lib/go_copy_module.so test_go_module.go)
- $(pwd)/output/bmf/bin/module_manager install go_copy_module go go_copy_module:PassThrough $(pwd)/output/test/go_module/lib v0.0.1
# download files
- (cd output && wget https://github.com/BabitMF/bmf/releases/download/files/files.tar.gz && tar xvf files.tar.gz && rm -rf files.tar.gz)
- (cd output && wget https://github.com/BabitMF/bmf/releases/download/files/models.tar.gz && tar xvf models.tar.gz && rm -rf models.tar.gz)
# test bmf
- (cd output/bmf/bin && ./test_bmf_module_sdk && ./test_bmf_engine && ./test_cpp_builder)
#(cd output/bmf/bin && ./test_builtin_modules)
- (cd output/demo/transcode && python3 test_transcode.py)
- (cd output/demo/edit && python3 test_edit.py)
- (cd output/demo/predict && python3 predict_sample.py)
- (cd output/test/audio_copy && python3 test_simple.py)
- (cd output/test/pre_module && python3 test_pre_module.py)
- (cd output/test/sync_mode && python3 test_sync_mode.py)
- (cd output/test/generator && python3 test_generator.py)
- (cd output/test/run_by_config && python3 test_run_by_config.py)
- (cd output/test/server && python3 test_server.py)
- (cd output/test/c_module && python3 test_video_c_module.py)
- (cd output/test/dynamical_graph && python3 dynamical_graph.py)
- (cd output/test/av_log_buffer && python3 test_av_log_buffer.py)
- (cd output/test/push_data_into_graph && python3 test_push_data.py)
- (cd output/test/complex_edit_case && python3 test_complex_case.py)
- (cd output/test/complex_edit_case && python3 test_compare_with_edit.py)
# test hmp
- (cd bmf/hml/tests/data && ./gen.sh $(pwd)/../../../../output/files)
- (cd bmf/hml/tests && pytest)
- name: run_go_test
commands:
- mkdir go
- (cd go && wget https://github.com/BabitMF/bmf/releases/download/files/files.tar.gz && tar xvf files.tar.gz && rm -rf files.tar.gz)
- $(pwd)/output/bmf/bin/module_manager install my_module python my_module:my_module $(pwd)/output/test/customize_module v0.0.1
- export GOPATH=$PWD/go
- export C_INCLUDE_PATH=${C_INCLUDE_PATH}:$(pwd)/output/bmf/include
- export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:$(pwd)/output/bmf/include
- export LIBRARY_PATH=${LIBRARY_PATH}:$(pwd)/output/bmf/lib
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/output/bmf/lib:/usr/local/lib
- export PYTHONPATH=$(pwd)/output/bmf/lib:$(pwd)/output:$(pwd)/output/test
- export PATH=${PATH}:$(pwd)/output/bmf/bin
- export HMP_TEST_DATA_ROOT=$(pwd)/bmf/hml/tests/data
- mkdir -p $GOPATH/src/main
- cp -r $PWD/bmf/test/test_go/* $GOPATH/src/main
- cd $GOPATH/src/main
- export GO111MODULE=on
- go mod init
- commit=$(cat ../../../gosdk_version.txt) && go get github.com/babitmf/bmf-gosdk@${commit}
- go build main.go
- python3 test_go.py

0 comments on commit ed8cec5

Please sign in to comment.