未验证 提交 d9c71994 编写于 作者: B BUG1989 提交者: GitHub

update ci, split the workflow file, add compilation test of vs2017 and vs2019 on x86_64 (#638)

* update ci

* fix error of ci on vs2017

* fix error of ci on vs2017 and add vs2019

* add the x86 platform for ci with vs17 vs19
上级 978b9ec2
name: android-armv7-cpu
on: [push, pull_request]
jobs:
android-armv7-cpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_PLATFORM=android-19 ..
- name: build
run: cmake --build build -j 2
name: android-armv8-cpu
on: [push, pull_request]
jobs:
android-armv8-cpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 ..
- name: build
run: cmake --build build -j 2
name: linux-armv7-cpu-gcc
on: [push, pull_request]
jobs:
linux-armv7-cpu-gcc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: cache-qemu
id: cache-qemu
uses: actions/cache@v1
with:
path: qemu-install
key: qemu-arm-install-1
- name: checkout-qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: qemu/qemu
path: qemu
ref: 8746309137ba470d1b2e8f5ce86ac228625db940
- name: qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
cd qemu
./configure --prefix=install --target-list=arm-linux-user --disable-system
make -j2
make install
cp -r arm-linux-user/install $GITHUB_WORKSPACE/qemu-install
- name: arm-gnu-toolchain
run: |
sudo apt-get update
sudo apt-get install g++-arm-linux-gnueabi
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DTENGINE_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: models
run: |
cd build
wget http://198.55.120.234/lite/models.zip
unzip models.zip
wget http://198.55.120.234/lite/arm32_data.zip
unzip arm32_data.zip
mv arm32_data data
wget http://198.55.120.234/lite/images.zip
unzip images.zip
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
chmod +x ./tests/test_arm32.sh
cd build
../tests/test_arm32.sh
name: linux-armv8-cpu-gcc
on: [push, pull_request]
jobs:
linux-armv8-cpu-gcc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: cache-qemu
id: cache-qemu
uses: actions/cache@v1
with:
path: qemu-install
key: qemu-aarch64-install-1
- name: checkout-qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: qemu/qemu
path: qemu
ref: 8746309137ba470d1b2e8f5ce86ac228625db940
- name: qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
cd qemu
./configure --prefix=install --target-list=aarch64-linux-user --disable-system
make -j2
make install
cp -r aarch64-linux-user/install $GITHUB_WORKSPACE/qemu-install
- name: aarch64-gnu-toolchain
run: |
sudo apt-get update
sudo apt-get install g++-aarch64-linux-gnu
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DTENGINE_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: models
run: |
cd build
wget http://198.55.120.234/lite/models.zip
unzip models.zip
wget http://198.55.120.234/lite/arm64_data.zip
unzip arm64_data.zip
mv arm64_data data
wget http://198.55.120.234/lite/images.zip
unzip images
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
chmod +x ./tests/test_arm64.sh
cd build
../tests/test_arm64.sh
\ No newline at end of file
name: linux-x64-cpu-clang
on: [push, pull_request]
jobs:
linux-x64-cpu-clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update
run: sudo apt-get update
- name: protobuf
run: sudo apt-get install libopencv-dev
- name: configure
env:
CC: clang
CXX: clang++
run: mkdir build && cd build && cmake -DTENGINE_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: models
run: |
cd build
wget http://198.55.120.234/lite/models.zip
unzip models.zip
wget http://198.55.120.234/lite/x86_data.zip
unzip x86_data.zip
mv x86_data data
wget http://198.55.120.234/lite/images.zip
unzip images.zip
- name: test
run: |
chmod +x ./tests/test.sh
cd build
../tests/test.sh
\ No newline at end of file
name: linux-x64-cpu-gcc
on: [push, pull_request]
jobs:
linux-x64-cpu-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update
run: sudo apt-get update
- name: protobuf
run: sudo apt-get install libopencv-dev
- name: configure
run: mkdir build && cd build && cmake -DTENGINE_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: models
run: |
cd build
wget http://198.55.120.234/lite/models.zip
unzip models.zip
wget http://198.55.120.234/lite/x86_data.zip
unzip x86_data.zip
mv x86_data data
wget http://198.55.120.234/lite/images.zip
unzip images.zip
- name: test
run: |
chmod +x ./tests/test.sh
cd build
../tests/test.sh
name: linux-x64-cpu-timvx-gcc
on: [push, pull_request]
jobs:
linux-x64-cpu-timvx-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update
run: sudo apt-get update
- name: protobuf
run: sudo apt-get install libopencv-dev
- name: tim-vx
run: |
git clone https://github.com/VeriSilicon/TIM-VX.git
export LD_LIBRARY_PATH=${PWD}/3rdparty/tim-vx/lib/x86_64
mkdir -p ./3rdparty/tim-vx/include
mkdir -p ./3rdparty/tim-vx/lib/x86_64
cp -rvf ./TIM-VX/prebuilt-sdk/x86_64_linux/include/* ./3rdparty/tim-vx/include/
cp -rvf ./TIM-VX/prebuilt-sdk/x86_64_linux/lib/* ./3rdparty/tim-vx/lib/x86_64/
cp -rvf ./TIM-VX/include ./source/device/tim-vx/
cp -rvf ./TIM-VX/src ./source/device/tim-vx/
- name: configure
run: mkdir build && cd build && cmake -DTENGINE_ENABLE_TIM_VX=ON ..
- name: build
run: cmake --build build -j 2
name: windows-x64-cpu-vs2017
on: [push, pull_request]
jobs:
windows-x64-cpu-vs2017:
runs-on: windows-2016
steps:
- uses: actions/checkout@v1
- name: build
run: |
mkdir build; cd build
cmake -T v141,host=x64 -A x64 -DTENGINE_OPENMP=OFF -DTENGINE_BUILD_EXAMPLES=OFF ..
cmake --build . --config Release -j 2
name: windows-x64-cpu-vs2019
on: [push, pull_request]
jobs:
windows-x64-cpu-vs2019:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: build
run: |
mkdir build; cd build
cmake -A x64 -DTENGINE_OPENMP=OFF -DTENGINE_BUILD_EXAMPLES=OFF ..
cmake --build . --config Release -j 2
name: windows-x86-cpu-vs2017
on: [push, pull_request]
jobs:
windows-x86-cpu-vs2017:
runs-on: windows-2016
steps:
- uses: actions/checkout@v1
- name: build
run: |
mkdir build; cd build
cmake -T v141,host=x64 -A Win32 -DTENGINE_OPENMP=OFF -DTENGINE_BUILD_EXAMPLES=OFF ..
cmake --build . --config Release -j 2
name: windows-x86-cpu-vs2019
on: [push, pull_request]
jobs:
windows-x86-cpu-vs2019:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: build
run: |
mkdir build; cd build
cmake -T v142,host=x64 -A Win32 -DTENGINE_OPENMP=OFF -DTENGINE_BUILD_EXAMPLES=OFF ..
cmake --build . --config Release -j 2
name: tengine-lite-actions
on: [push, pull_request]
jobs:
linux-gcc-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update
run: sudo apt-get update
- name: protobuf
run: sudo apt-get install libopencv-dev
- name: configure
run: mkdir build && cd build && cmake -DTENGINE_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: models
run: |
cd build
wget http://198.55.120.234/lite/models.zip
unzip models.zip
wget http://198.55.120.234/lite/x86_data.zip
unzip x86_data.zip
mv x86_data data
wget http://198.55.120.234/lite/images.zip
unzip images.zip
- name: test
run: |
chmod +x ./tests/test.sh
cd build
../tests/test.sh
linux-gcc-arm32:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: cache-qemu
id: cache-qemu
uses: actions/cache@v1
with:
path: qemu-install
key: qemu-arm-install-1
- name: checkout-qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: qemu/qemu
path: qemu
ref: 8746309137ba470d1b2e8f5ce86ac228625db940
- name: qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
cd qemu
./configure --prefix=install --target-list=arm-linux-user --disable-system
make -j2
make install
cp -r arm-linux-user/install $GITHUB_WORKSPACE/qemu-install
- name: arm-gnu-toolchain
run: |
sudo apt-get update
sudo apt-get install g++-arm-linux-gnueabi
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DTENGINE_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: models
run: |
cd build
wget http://198.55.120.234/lite/models.zip
unzip models.zip
wget http://198.55.120.234/lite/arm32_data.zip
unzip arm32_data.zip
mv arm32_data data
wget http://198.55.120.234/lite/images.zip
unzip images.zip
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
chmod +x ./tests/test_arm32.sh
cd build
../tests/test_arm32.sh
linux-gcc-aarch64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: cache-qemu
id: cache-qemu
uses: actions/cache@v1
with:
path: qemu-install
key: qemu-aarch64-install-1
- name: checkout-qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: qemu/qemu
path: qemu
ref: 8746309137ba470d1b2e8f5ce86ac228625db940
- name: qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
cd qemu
./configure --prefix=install --target-list=aarch64-linux-user --disable-system
make -j2
make install
cp -r aarch64-linux-user/install $GITHUB_WORKSPACE/qemu-install
- name: aarch64-gnu-toolchain
run: |
sudo apt-get update
sudo apt-get install g++-aarch64-linux-gnu
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DTENGINE_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: models
run: |
cd build
wget http://198.55.120.234/lite/models.zip
unzip models.zip
wget http://198.55.120.234/lite/arm64_data.zip
unzip arm64_data.zip
mv arm64_data data
wget http://198.55.120.234/lite/images.zip
unzip images
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
chmod +x ./tests/test_arm64.sh
cd build
../tests/test_arm64.sh
linux-gcc-x86-timvx-simulator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update
run: sudo apt-get update
- name: protobuf
run: sudo apt-get install libopencv-dev
- name: tim-vx
run: |
git clone https://github.com/VeriSilicon/TIM-VX.git
export LD_LIBRARY_PATH=${PWD}/3rdparty/tim-vx/lib/x86_64
mkdir -p ./3rdparty/tim-vx/include
mkdir -p ./3rdparty/tim-vx/lib/x86_64
cp -rvf ./TIM-VX/prebuilt-sdk/x86_64_linux/include/* ./3rdparty/tim-vx/include/
cp -rvf ./TIM-VX/prebuilt-sdk/x86_64_linux/lib/* ./3rdparty/tim-vx/lib/x86_64/
cp -rvf ./TIM-VX/include ./source/device/tim-vx/
cp -rvf ./TIM-VX/src ./source/device/tim-vx/
- name: configure
run: mkdir build && cd build && cmake -DTENGINE_ENABLE_TIM_VX=ON ..
- name: build
run: cmake --build build -j 2
android-armv7-a:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_PLATFORM=android-19 ..
- name: build
run: cmake --build build -j 2
android-armv8-a:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 ..
- name: build
run: cmake --build build -j 2
......@@ -21,16 +21,14 @@
### 1.1 下载 Tengine Lite 源码
下载 Tengine Lite 源码,位于 Tengine 的分支 tengine-lite 上:
```bash
git clone -b tengine-lite https://github.com/OAID/Tengine.git Tengine-Lite
git clone https://github.com/OAID/Tengine.git tengine-lite
```
### 1.2 编译 Tengine Lite
```bash
cd Tengine-Lite
cd tengine-lite
mkdir build
cd build
cmake ..
......@@ -57,7 +55,7 @@ install
### 2.1 下载源码
```bash
git clone -b tengine-lite https://github.com/OAID/Tengine.git Tengine-Lite
git clone https://github.com/OAID/Tengine.git tengine-lite
```
### 2.2 安装交叉编译工具链
......@@ -104,9 +102,12 @@ make install
### 3.1 安装 Android NDK
传送门 http://developer.android.com/ndk/downloads/index.html
下载 Android NDK http://developer.android.com/ndk/downloads/index.html 并安装,例如:
比如我把 android-ndk 解压到 /home/openailab/android-ndk-r18b
```
unzip android-ndk-r21d-linux-x86_64.zip
export ANDROID_NDK=<your-ndk-root-path>
```
### 3.2 准备 android toolchain 文件
......@@ -125,7 +126,7 @@ list(APPEND ANDROID_COMPILER_FLAGS
### 3.3 下载 Tengine Lite 源码
```bash
git clone -b tengine-lite https://github.com/OAID/Tengine.git Tengine-Lite
git clone https://github.com/OAID/Tengine.git tengine-lite
```
### 3.4 编译 Tengine Lite
......@@ -135,7 +136,7 @@ Arm64 Android 编译命令如下:
```bash
mkdir build-android-aarch64
cd build-android-aarch64
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build-android-aarch64/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 ..
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 ..
make
make install
```
......@@ -197,7 +198,7 @@ list(APPEND ANDROID_COMPILER_FLAGS
### 5.3 下载 Tengine Lite 源码
```bash
git clone -b tengine-lite https://github.com/OAID/Tengine.git Tengine-Lite
git clone https://github.com/OAID/Tengine.git tengine-lite
```
### 5.4 编译 Tengine Lite
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册