build-and-test.yml 8.7 KB
Newer Older
D
daquexian 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
name: Build and test

on:
  push:
    branches: [tengine-lite]
    paths:
    paths-ignore: 
    - 'doc/**'
    - 'README.md'
    - 'README_EN.md'
  pull_request:
    branches: [tengine-lite]
    paths-ignore: 
    - 'doc/**'
    - 'README.md'
    - 'README_EN.md'

jobs:
  android-armv7-cpu:
    runs-on: ubuntu-latest
    steps:
22
    - uses: actions/checkout@v3
D
daquexian 已提交
23
    - name: configure
24
      run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_PLATFORM=android-19 ..
D
daquexian 已提交
25 26 27
    - name: build
      run: cmake --build build -j 2

B
BUG1989 已提交
28

D
daquexian 已提交
29 30 31
  android-armv8-cpu:
    runs-on: ubuntu-latest
    steps:
32
    - uses: actions/checkout@v3
D
daquexian 已提交
33
    - name: configure
34
      run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 ..
D
daquexian 已提交
35 36 37 38
    - name: build
      run: cmake --build build -j 2


B
BUG1989 已提交
39 40
  linux-armv7-cpu-gcc:
    runs-on: ubuntu-20.04
reachfoo's avatar
reachfoo 已提交
41
    steps:
42
    - uses: actions/checkout@v3
B
BUG1989 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    - name: cache-qemu
      id: cache-qemu
      uses: actions/cache@v3
      with:
        path: qemu-install
        key: qemu-arm-install-1
    - name: checkout-qemu
      if: steps.cache-qemu.outputs.cache-hit != 'true'
      uses: actions/checkout@v3
      with:
        repository: qemu/qemu
        path: qemu
        ref: 8746309137ba470d1b2e8f5ce86ac228625db940
    - name: qemu
      if: steps.cache-qemu.outputs.cache-hit != 'true'
reachfoo's avatar
reachfoo 已提交
58
      run: |
B
BUG1989 已提交
59 60 61 62 63 64 65 66 67
        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
reachfoo's avatar
reachfoo 已提交
68
    - name: configure
B
BUG1989 已提交
69
      run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DTENGINE_BUILD_TESTS=ON ..
reachfoo's avatar
reachfoo 已提交
70
    - name: build
B
BUG1989 已提交
71 72 73 74 75
      run: cmake --build build -j 2


  linux-armv8-cpu-gcc:
    runs-on: ubuntu-20.04
reachfoo's avatar
reachfoo 已提交
76
    steps:
77
    - uses: actions/checkout@v3
B
BUG1989 已提交
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
    - name: cache-qemu
      id: cache-qemu
      uses: actions/cache@v3
      with:
        path: qemu-install
        key: qemu-aarch64-install-1
    - name: checkout-qemu
      if: steps.cache-qemu.outputs.cache-hit != 'true'
      uses: actions/checkout@v3
      with:
        repository: qemu/qemu
        path: qemu
        ref: 8746309137ba470d1b2e8f5ce86ac228625db940
    - name: qemu
      if: steps.cache-qemu.outputs.cache-hit != 'true'
reachfoo's avatar
reachfoo 已提交
93
      run: |
B
BUG1989 已提交
94 95 96 97 98 99
        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
reachfoo's avatar
reachfoo 已提交
100
      run: |
B
BUG1989 已提交
101 102 103 104 105 106
        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
reachfoo's avatar
reachfoo 已提交
107
        
D
daquexian 已提交
108 109 110 111
  linux-gcc-mipsisa64r6el:
    runs-on: ubuntu-20.04
    steps:
    - name: cancel-previous-runs
112
      uses: styfle/cancel-workflow-action@0.10.1
D
daquexian 已提交
113 114
      with:
        access_token: ${{ secrets.GITHUB_TOKEN }}
115
    - uses: actions/checkout@v3
D
daquexian 已提交
116 117
    - name: cache-qemu
      id: cache-qemu
118
      uses: actions/cache@v3
D
daquexian 已提交
119 120 121 122 123
      with:
        path: qemu-install
        key: qemu-mips64el-install-1
    - name: checkout-qemu
      if: steps.cache-qemu.outputs.cache-hit != 'true'
124
      uses: actions/checkout@v3
D
daquexian 已提交
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
      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=mips64el-linux-user --disable-system
        make -j2
        make install
        cp -r mips64el-linux-user/install $GITHUB_WORKSPACE/qemu-install
    - name: mipsisa64r6el-gnuabi64-toolchain
      run: |
        sudo apt-get update
        sudo apt-get install g++-mipsisa64r6el-linux-gnuabi64
    - name: configure
      run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake -DTENGINE_BUILD_EXAMPLES=OFF ..
    - name: build
      run: cmake --build build -j 2

B
BUG1989 已提交
146

D
daquexian 已提交
147 148 149
  windows-x64-cpu-vs2017:
    runs-on: windows-2016
    steps:
150
    - uses: actions/checkout@v3
D
daquexian 已提交
151 152 153 154 155 156
    - 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

B
BUG1989 已提交
157

D
daquexian 已提交
158 159 160
  windows-x64-cpu-vs2019:
    runs-on: windows-latest
    steps:
161
    - uses: actions/checkout@v3
D
daquexian 已提交
162 163 164 165 166 167
    - name: build
      run: |
        mkdir build; cd build
        cmake -A x64 -DTENGINE_BUILD_EXAMPLES=OFF ..
        cmake --build . --config Release -j 2

B
BUG1989 已提交
168

D
daquexian 已提交
169 170 171
  windows-x86-cpu-vs2017:
    runs-on: windows-2016
    steps:
172
    - uses: actions/checkout@v3
D
daquexian 已提交
173 174 175 176 177 178
    - 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

B
BUG1989 已提交
179

D
daquexian 已提交
180 181 182
  windows-x86-cpu-vs2019:
    runs-on: windows-latest
    steps:
183
    - uses: actions/checkout@v3
D
daquexian 已提交
184 185 186 187 188 189
    - name: build
      run: |
        mkdir build; cd build
        cmake -T v142,host=x64 -A Win32 -DTENGINE_BUILD_EXAMPLES=OFF ..
        cmake --build . --config Release -j 2

B
BUG1989 已提交
190

B
BUG1989 已提交
191
  linux-x64-timvx-gcc:
D
daquexian 已提交
192 193
    runs-on: ubuntu-latest
    steps:
194
    - uses: actions/checkout@v3
D
daquexian 已提交
195 196
    - name: update
      run: sudo apt-get update
B
BUG1989 已提交
197
    - name: libopencv
D
daquexian 已提交
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
      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/
        rm ./source/device/tim-vx/src/tim/vx/*_test.cc
        rm ./source/device/tim-vx/src/tim/vx/ops/*_test.cc
    - name: configure
      run: mkdir build && cd build && cmake -DTENGINE_ENABLE_TIM_VX=ON ..
    - name: build
      run: cmake --build build -j 2

B
BUG1989 已提交
216

B
BUG1989 已提交
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
  linux-aarch64-timvx-gcc:
    runs-on: vim3
    steps:
    - uses: actions/checkout@v3
    - name: tim-vx
      run: |
        git clone https://github.com/VeriSilicon/TIM-VX.git
        cp -rvf ./TIM-VX/include  ./source/device/tim-vx/
        cp -rvf ./TIM-VX/src      ./source/device/tim-vx/
        rm ./source/device/tim-vx/src/tim/vx/*_test.cc
        rm ./source/device/tim-vx/src/tim/vx/ops/*_test.cc
    - name: configure
      run: mkdir build && cd build && cmake -DTENGINE_BUILD_TESTS=ON -DTENGINE_ENABLE_TIM_VX=ON ..
    - name: build
      run: cmake --build build -j 4


D
daquexian 已提交
234
  linux-x64-cpu-gcc:
B
BUG1989 已提交
235
    runs-on: ubuntu-latest
D
daquexian 已提交
236
    steps:
237
    - uses: actions/checkout@v3
B
BUG1989 已提交
238 239 240 241
    - name: update
      run: sudo apt-get update
    - name: depends
      run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev
D
daquexian 已提交
242
    - name: configure
B
BUG1989 已提交
243
      run: mkdir build && cd build && cmake ..
D
daquexian 已提交
244
    - name: build
B
BUG1989 已提交
245 246
      run: cmake --build build -j 2

D
daquexian 已提交
247 248

  linux-x64-cpu-clang:
B
BUG1989 已提交
249
    runs-on: ubuntu-latest
D
daquexian 已提交
250
    steps:
251
    - uses: actions/checkout@v3
B
BUG1989 已提交
252 253 254 255
    - name: update
      run: sudo apt-get update
    - name: depends
      run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev
D
daquexian 已提交
256 257 258 259
    - name: configure
      env:
        CC: clang
        CXX: clang++    
B
BUG1989 已提交
260
      run: mkdir build && cd build && cmake -DTENGINE_BUILD_TESTS=ON -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX  ..
D
daquexian 已提交
261
    - name: build
B
BUG1989 已提交
262 263
      run: cmake --build build -j 2
  
D
daquexian 已提交
264 265
        
  linux-x64-cpu-tools-convert:
B
BUG1989 已提交
266
    runs-on: ubuntu-latest
D
daquexian 已提交
267
    steps:
268
    - uses: actions/checkout@v3
B
BUG1989 已提交
269 270 271 272
    - name: update
      run: |
        sudo apt-get update
        sudo apt-get install libprotobuf-dev protobuf-compiler
B
BowShotDS 已提交
273
    - name: configure
B
BUG1989 已提交
274
      run: mkdir build && cd build && cmake -DTENGINE_BUILD_CONVERT_TOOL=ON ..
B
BowShotDS 已提交
275
    - name: build
B
BUG1989 已提交
276
      run: cmake --build build -j 2
D
daquexian 已提交
277 278

  linux-x64-cpu-tools-quant:
B
BUG1989 已提交
279
    runs-on: ubuntu-latest
D
daquexian 已提交
280
    steps:
281
    - uses: actions/checkout@v3
B
BUG1989 已提交
282 283 284 285
    - name: update
      run: |
        sudo apt-get update
        sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev
D
daquexian 已提交
286
    - name: configure
B
BUG1989 已提交
287
      run: mkdir build && cd build && cmake -DTENGINE_BUILD_QUANT_TOOL=ON ..
D
daquexian 已提交
288
    - name: build
B
BUG1989 已提交
289 290
      run: cmake --build build -j2