build it #45
Workflow file for this run
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
name: test | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
jobs: | |
luckfox-pico-opencv4: | |
runs-on: ubuntu-latest | |
env: | |
OPENCV_VERSION: 4.8.1 | |
PACKAGENAME: opencv-mobile-4.8.1-luckfox-pico | |
steps: | |
- uses: actions/checkout@v3 | |
- name: toolchain | |
run: | | |
git clone --depth 1 https://github.com/LuckfoxTECH/luckfox-pico.git luckfox-pico | |
- name: opencv-source | |
run: | | |
wget -q https://github.com/opencv/opencv/archive/${{ env.OPENCV_VERSION }}.zip -O opencv-${{ env.OPENCV_VERSION }}.zip | |
unzip -q opencv-${{ env.OPENCV_VERSION }}.zip | |
cd opencv-${{ env.OPENCV_VERSION }} | |
truncate -s 0 cmake/OpenCVFindLibsGrfmt.cmake | |
rm -rf modules/gapi | |
patch -p1 -i ../opencv-4.8.1-no-rtti.patch | |
patch -p1 -i ../opencv-4.8.1-no-zlib.patch | |
patch -p1 -i ../opencv-4.8.1-no-atomic.patch | |
patch -p1 -i ../opencv-4.8.1-link-openmp.patch | |
rm -rf modules/highgui | |
cp -r ../highgui modules/ | |
- name: build | |
run: | | |
cd opencv-${{ env.OPENCV_VERSION }} | |
mkdir build && cd build | |
export TOOLCHAIN_ROOT_PATH=$GITHUB_WORKSPACE/luckfox-pico/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf | |
cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/arm-rockchip830-linux-uclibcgnueabihf.toolchain.cmake \ | |
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \ | |
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv4_cmake_options.txt` -DBUILD_opencv_world=OFF \ | |
-DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON -DWITH_OPENMP=OFF -DOPENCV_DISABLE_THREAD_SUPPORT=ON .. | |
cmake --build . -j 2 | |
cmake --build . --target install | |
- name: package | |
run: | | |
mkdir ${{ env.PACKAGENAME }} | |
cp -rf opencv-${{ env.OPENCV_VERSION }}/build/install/* ${{ env.PACKAGENAME }}/ | |
rm -rf ${{ env.PACKAGENAME }}/share/opencv4 | |
zip -9 -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }} | |
- name: test | |
run: | | |
cd test | |
mkdir build && cd build | |
export TOOLCHAIN_ROOT_PATH=$GITHUB_WORKSPACE/luckfox-pico/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf | |
cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/arm-rockchip830-linux-uclibcgnueabihf.toolchain.cmake \ | |
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \ | |
-DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGENAME }}/lib/cmake/opencv4 .. | |
cmake --build . -j 2 | |
- name: upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.PACKAGENAME }} | |
path: ${{ env.PACKAGENAME }}.zip |