-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from JDAI-CV/ci
Replace travis and appveyor with azure pipeline
- Loading branch information
Showing
50 changed files
with
365 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Configuration for [project_manager.vim](https://github.com/daquexian/project_manager.vim) | ||
name DNNLibrary | ||
type cpp | ||
build_dir build-all-v27 | ||
cmake_options -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-27 -DANDROID_ABI=arm64-v8a -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -GNinja |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! /usr/bin/env bash | ||
|
||
# echo "${@:2}" | ||
adb push $1 /data/local/tmp/`basename $1` && adb shell "data/local/tmp/`basename $1` ${@:2}" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -e | ||
|
||
nproc=$(ci/get_cores.sh) | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
echo "The system is Mac OS X, alias sed to gsed" | ||
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" | ||
echo "Output of sed -v:" | ||
sed --version | ||
fi | ||
|
||
MY_ANDROID_HOME="${ANDROID_HOME:-$HOME/Android/Sdk}" | ||
MY_ANDROID_NDK_HOME="${ANDROID_NDK_HOME:-$MY_ANDROID_HOME/ndk-bundle}" | ||
JNI_BUILD_DIR=build_jni_tmp | ||
rm -rf ${JNI_BUILD_DIR} && mkdir ${JNI_BUILD_DIR} && pushd ${JNI_BUILD_DIR} | ||
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_TOOLCHAIN_FILE=${MY_ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake -DANDROID_CPP_FEATURES=exceptions -DANDROID_PLATFORM=android-27 -DANDROID_ABI=arm64-v8a -DDNN_BUILD_JNI=ON -DDNN_BUILD_BIN=OFF .. | ||
cmake --build . --target daq-jni -- -j$nproc | ||
popd | ||
mkdir -p ci/android_aar/dnnlibrary/src/main/jniLibs/arm64-v8a | ||
cp ${JNI_BUILD_DIR}/dnnlibrary/libdaq-jni.so ci/android_aar/dnnlibrary/src/main/jniLibs/arm64-v8a/ | ||
|
||
# Increase version code and update version name | ||
|
||
echo "Build source branch: $BUILD_SOURCEBRANCH" | ||
|
||
if (($# == 0)); then | ||
if [[ $BUILD_SOURCEBRANCH == refs/tags/v* ]]; then | ||
ver=`echo $BUILD_SOURCEBRANCH | cut -c 12-` | ||
else | ||
echo "HEAD is not tagged as a version, skip deploy aar" | ||
exit 0 | ||
fi | ||
elif (( $# == 1 )); then | ||
ver=$1 | ||
fi | ||
echo "ver=$ver" | ||
|
||
sed -i -E "s/versionName .+/versionName \"v$ver\"/" ci/android_aar/dnnlibrary/build.gradle | ||
sed -i -E "s/publishVersion = .+/publishVersion = \'$ver\'/" ci/android_aar/dnnlibrary/build.gradle | ||
|
||
cat ci/android_aar/dnnlibrary/build.gradle | ||
|
||
pushd ci/android_aar | ||
ANDROID_HOME=$MY_ANDROID_HOME ./gradlew clean build | ||
|
||
# Publishing is only for myself | ||
if [[ -z $BINTRAY_KEY ]]; then | ||
echo "BINTRAY_KEY is not set, skip bintray upload" | ||
else | ||
echo "Publishing.." | ||
ANDROID_HOME=$MY_ANDROID_HOME ./gradlew bintrayUpload -PbintrayUser=daquexian566 -PbintrayKey=$BINTRAY_KEY -PdryRun=false | ||
fi | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /usr/bin/env bash | ||
set -e | ||
|
||
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'ndk-bundle' | ||
nproc=$(ci/get_cores.sh) | ||
|
||
mkdir build_dnnlibrary && pushd build_dnnlibrary | ||
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-27 -DANDROID_ABI=x86_64 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DDNN_READ_ONNX=ON -DDNN_CUSTOM_PROTOC_EXECUTABLE=$BUILD_SOURCESDIRECTORY/protoc/bin/protoc .. | ||
cmake --build . -- -j$nproc | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /usr/bin/env bash | ||
set -e | ||
|
||
nproc=$(ci/get_cores.sh) | ||
|
||
mkdir build_onnx2daq && cd build_onnx2daq | ||
cmake .. | ||
cmake --build . -- -j$nproc | ||
cd - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- master | ||
tags: | ||
include: | ||
- v* | ||
paths: | ||
include: | ||
- '*' | ||
exclude: | ||
- README.md | ||
- docs/* | ||
pr: | ||
branches: | ||
include: | ||
- '*' | ||
paths: | ||
include: | ||
- '*' | ||
exclude: | ||
- README.md | ||
- docs/* | ||
|
||
pool: | ||
vmImage: 'macOS-10.14' | ||
steps: | ||
- checkout: self | ||
submodules: true | ||
- bash: brew install watch gnu-sed | ||
displayName: Install watch and gnu-sed | ||
- bash: ci/download_protoc.sh | ||
displayName: Download protoc | ||
- bash: ci/build_dnnlibrary.sh | ||
displayName: Build | ||
- bash: ci/start_android_emulator.sh | ||
displayName: Start Android Emulator | ||
- bash: pip3 install --user onnx | ||
displayName: Install ONNX | ||
- bash: ci/download_and_test_models.sh | ||
displayName: Download And Test Models | ||
- bash: ci/build_aar.sh | ||
env: | ||
BINTRAY_KEY: $(bintrayKey) | ||
displayName: Build and Publish AAR package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -e | ||
|
||
wget "https://s3.amazonaws.com/onnx-model-zoo/squeezenet/squeezenet1.1/squeezenet1.1.tar.gz" -O squeezenet1.1.tar.gz | ||
tar xvf squeezenet1.1.tar.gz | ||
python3 ci/validate_onnx.py squeezenet1.1 build_dnnlibrary/binaries/dnn_retrieve_result | ||
|
||
wget "https://s3.amazonaws.com/onnx-model-zoo/mobilenet/mobilenetv2-1.0/mobilenetv2-1.0.tar.gz" -O mobilenetv2-1.0.tar.gz | ||
tar xvf mobilenetv2-1.0.tar.gz | ||
python3 ci/validate_onnx.py mobilenetv2-1.0 build_dnnlibrary/binaries/dnn_retrieve_result | ||
|
||
wget "https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v2/resnet18v2.tar.gz" -O resnet18v2.tar.gz | ||
tar xvf resnet18v2.tar.gz | ||
python3 ci/validate_onnx.py resnet18v2 build_dnnlibrary/binaries/dnn_retrieve_result | ||
|
||
wget "https://s3.amazonaws.com/download.onnx/models/opset_9/bvlc_googlenet.tar.gz" -O bvlc_googlenet.tar.gz | ||
tar xvf bvlc_googlenet.tar.gz | ||
python3 ci/validate_onnx.py bvlc_googlenet build_dnnlibrary/binaries/dnn_retrieve_result | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#! /usr/bin/env bash | ||
set -e | ||
|
||
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-osx-x86_64.zip -O protoc.zip | ||
unzip protoc.zip -d protoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if [[ "$OSTYPE" == "drawin*" ]]; then | ||
echo $(sysctl -n hw.physicalcpu) | ||
else | ||
echo $(nproc) | ||
fi |
Oops, something went wrong.