diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml deleted file mode 100644 index 11ad0691..00000000 --- a/.github/workflows/android.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: android - -on: - push: - tags: - - "v*.*.*" - pull_request: - branches: [ "main" ] - -jobs: - android: - name: android - runs-on: ubuntu-24.04 - strategy: - matrix: - abi: [armeabi-v7a, arm64-v8a, x86_64] - env: - COMMON_CMAKE_OPTIONS: | - -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake \ - -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=False \ - -DANDROID_PLATFORM=android-24 \ - -DCMAKE_BUILD_TYPE=Release \ - -DANDROID_STL=c++_static \ - -DANDROID_ARM_NEON=ON \ - steps: - - uses: actions/checkout@v4 - with: - repository: 'rainyl/dartcv' - ref: 'main' - - name: build - run: | - mkdir build && cd build - cmake -S ${{ github.workspace }} \ - ${{ env.COMMON_CMAKE_OPTIONS }} -DANDROID_ABI="${{ matrix.abi }}" \ - -DCMAKE_INSTALL_PREFIX="${{ matrix.abi }}" \ - - cmake --build . --config Release -j $(nproc) - cmake --build . --config Release --target install - - uses: actions/upload-artifact@v4 - name: upload - with: - path: build/${{ matrix.abi }} - name: libdartcv-android-${{ matrix.abi }} - - release: - name: android - runs-on: ubuntu-24.04 - steps: - - name: download - uses: actions/download-artifact@v4 - with: - path: libdartcv-android - pattern: libdartcv-android* - merge-multiple: true - - name: package - run: | - ls -R libdartcv-android - tar -C libdartcv-android -zcvf libdartcv-android.tar.gz . - - name: release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - prerelease: false - files: | - libdartcv-android.tar.gz diff --git a/.github/workflows/apple.yaml b/.github/workflows/apple.yaml deleted file mode 100644 index 23895aaa..00000000 --- a/.github/workflows/apple.yaml +++ /dev/null @@ -1,174 +0,0 @@ -name: apple - -on: - push: - tags: - - "v*.*.*" - pull_request: - branches: [ "main" ] - -env: - IOS_DEPLOYMENT_TARGET: '11.0' - MAC_DEPLOYMENT_TARGET: '11.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF - -jobs: - macos: - name: macos - strategy: - matrix: - osname: - - {os: macos-13, arch: x64, platform: MAC} - - {os: macos-14, arch: arm64, platform: MAC_ARM64} - runs-on: ${{ matrix.osname.os }} - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: setup - run: | - brew install --force --overwrite ninja ccache ffmpeg@6 nasm - brew link --overwrite ffmpeg@6 - - uses: robinraju/release-downloader@v1.10 - with: - repository: "rainyl/opencv.full" - tag: "4.10.0+6" - fileName: "libopencv-macos-${{ matrix.osname.arch }}.tar.gz" - out-file-path: "build/opencv" - extract: true - - name: build - run: | - cd build - cmake -S ${{ github.workspace }} \ - -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/profiles/ios.toolchain.cmake \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET \ - -DENABLE_BITCODE=$ENABLE_BITCODE \ - -DENABLE_ARC=$ENABLE_ARC \ - -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_INSTALL_PREFIX=install \ - -DCMAKE_BUILD_TYPE=Release \ - -DPLATFORM=${{ matrix.osname.platform }} \ - -DCVD_PLATFORM_INSTALL_DIR="${{ github.workspace }}/macos" \ - -DOpenCV_DIR=${{ github.workspace }}/build/opencv/lib/cmake/opencv4 - - cmake --build . --config Release --target install - - name: package - run: | - tar -C build/install -zcvf libopencv_dart-macos-${{ matrix.osname.arch }}.tar.gz . - - uses: actions/upload-artifact@v4 - name: upload - with: - path: build/install/libopencv_dart.dylib - name: libopencv_dart-macos-${{ matrix.osname.arch }} - - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.19.6' - channel: "stable" - - name: test - run: | - export OPENCV_DART_LIB_PATH="${{github.workspace}}/macos/libopencv_dart.dylib" - dart pub get - dart test -x skip-workflow,no-local-files - - name: release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - prerelease: false - files: | - libopencv_dart-macos-${{ matrix.osname.arch }}.tar.gz - release: - permissions: - contents: write # for softprops/action-gh-release to create a release - needs: [macos] - runs-on: macos-14 - steps: - - name: download - uses: actions/download-artifact@v4 - with: - path: artifacts - pattern: libopencv_dart-macos-* - merge-multiple: false - - name: lipo - run: | - ls -R - cd artifacts - lipo -create -output libopencv_dart.dylib */libopencv_dart.dylib - lipo -info libopencv_dart.dylib - tar -zcvf libopencv_dart-macos-os64.tar.gz libopencv_dart.dylib - - name: create-release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - prerelease: false - token: ${{ secrets.GITHUB_TOKEN }} - files: artifacts/libopencv_dart-macos-os64.tar.gz - ios: - name: ios - runs-on: macos-14 - env: - COMMON_CMAKE_OPTIONS: | - -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/profiles/ios.toolchain.cmake \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET \ - -DENABLE_BITCODE=$ENABLE_BITCODE \ - -DENABLE_ARC=$ENABLE_ARC \ - -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_INSTALL_PREFIX=install \ - -DCMAKE_BUILD_TYPE=Release \ - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: robinraju/release-downloader@v1.10 - with: - repository: "rainyl/opencv.full" - tag: "4.10.0+6" - fileName: "libopencv-ios-x64.tar.gz" - out-file-path: "build/opencv/x64" - extract: true - - uses: robinraju/release-downloader@v1.10 - with: - repository: "rainyl/opencv.full" - tag: "4.10.0+6" - fileName: "libopencv-ios-arm64.tar.gz" - out-file-path: "build/opencv/arm64" - extract: true - - name: build_simulator64 - run: | - mkdir -p build/x64 && cd build/x64 - cmake -S ${{ github.workspace }} \ - ${{ env.COMMON_CMAKE_OPTIONS }} -DPLATFORM=SIMULATOR64 \ - -DOpenCV_DIR=${{ github.workspace }}/build/opencv/x64/lib/cmake/opencv4 - - cmake --build . --config Release --target install - - name: build_os64 - run: | - mkdir -p build/os64 && cd build/os64 - cmake -S ${{ github.workspace }} \ - ${{ env.COMMON_CMAKE_OPTIONS }} -DPLATFORM=OS64 \ - -DOpenCV_DIR=${{ github.workspace }}/build/opencv/arm64/lib/cmake/opencv4 - - cmake --build . --config Release --target install - - name: package - run: | - xcodebuild -create-xcframework \ - -framework build/x64/install/opencv_dart.framework \ - -framework build/os64/install/opencv_dart.framework \ - -output opencv_dart.xcframework - tar -zcvf libopencv_dart-ios-os64.tar.gz opencv_dart.xcframework - - uses: actions/upload-artifact@v4 - name: upload - with: - path: libopencv_dart-ios-os64.tar.gz - name: libopencv_dart-ios-os64.tar.gz - - name: release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - prerelease: false - files: | - libopencv_dart-ios-os64.tar.gz diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 00000000..9591df0f --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,45 @@ +name: coverage + +on: + push: + branches: ["main"] + pull_request: + branches: [ "main" ] + +jobs: + windows: + name: windows + runs-on: windows-2019 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: robinraju/release-downloader@v1.10 + with: + repository: "rainyl/opencv_dart" + tag: "dnn_test_files" + fileName: "models.zip" + out-file-path: "packages/dartcv/test/" + extract: true + - uses: robinraju/release-downloader@v1.10 + with: + repository: "rainyl/dartcv" + latest: true + fileName: "libdartcv-windows-x64-vs2019.tar.gz" + out-file-path: "packages/dartcv/libdartcv" + extract: true + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + - name: test coverage + run: | + cd "${{github.workspace}}\packages\dartcv" + $env:PATH="${{github.workspace}}\packages\dartcv\libdartcv\lib;$env:PATH" + dart pub global activate coverage + dart pub global run coverage:test_with_coverage --package . --package-name opencv_dart + - name: Upload to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: rainyl/opencv_dart + file: ./coverage/lcov.info diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml deleted file mode 100644 index 1ed45069..00000000 --- a/.github/workflows/linux.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: linux - -on: - push: - tags: - - "v*.*.*" - pull_request: - branches: [ "main" ] - -jobs: - ubuntu: - name: ubuntu - runs-on: ubuntu-22.04 - strategy: - matrix: - arch: [x64] - env: - COMMON_CMAKE_OPTIONS: | - -DCMAKE_INSTALL_PREFIX=install \ - -DCMAKE_BUILD_TYPE=Release \ - -DCVD_PLATFORM_INSTALL_DIR="${{ github.workspace }}/linux" \ - - steps: - - name: setup - run: | - sudo apt-get update - - sudo apt-get install -y curl unzip build-essential \ - libgtk-3-dev ffmpeg libavcodec-dev \ - cmake ninja-build libavformat-dev libavutil-dev \ - libswscale-dev libgflags-dev \ - libjpeg-dev libpng-dev libtiff-dev - - uses: actions/checkout@v4 - with: - submodules: true - - uses: robinraju/release-downloader@v1.10 - with: - repository: "rainyl/opencv.full" - tag: "4.10.0+6" - fileName: "libopencv-linux-${{ matrix.arch }}.tar.gz" - out-file-path: "build/opencv" - extract: true - - name: build - run: | - cd build - cmake -S ${{ github.workspace }} \ - ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DOpenCV_DIR=${{ github.workspace }}/build/opencv/lib/cmake/opencv4 - - cmake --build . --config Release -j $(nproc) - cmake --build . --config Release --target install - - name: package - run: | - tar -C build/install -zcvf libopencv_dart-linux-${{ matrix.arch }}.tar.gz . - - uses: actions/upload-artifact@v4 - name: upload - with: - path: libopencv_dart-linux-${{ matrix.arch }}.tar.gz - name: libopencv_dart-linux-${{ matrix.arch }}.tar.gz - - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.19.6' - channel: "stable" - - name: test - run: | - export OPENCV_DART_LIB_PATH="${{github.workspace}}/linux/libopencv_dart.so" - dart pub get - dart test -x skip-workflow,no-local-files - - name: release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - prerelease: false - files: | - libopencv_dart-linux-${{ matrix.arch }}.tar.gz diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml deleted file mode 100644 index 7c3c68f5..00000000 --- a/.github/workflows/windows.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: windows - -on: - push: - branches: ["main"] - tags: - - "v*.*.*" - pull_request: - branches: [ "main" ] - -jobs: - windows: - name: windows - runs-on: windows-2019 - strategy: - matrix: - arch: [x64] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: robinraju/release-downloader@v1.10 - with: - repository: "rainyl/opencv.full" - tag: "4.10.0+6" - fileName: "libopencv-windows-${{ matrix.arch }}.tar.gz" - out-file-path: "build/opencv" - extract: true - - name: build - run: | - cd build - cmake -DCMAKE_INSTALL_PREFIX=install ` - -DCMAKE_BUILD_TYPE=Release ` - -DCVD_PLATFORM_INSTALL_DIR="${{ github.workspace }}/windows" ` - -DOpenCV_DIR=${{ github.workspace }}/build/opencv .. - - cmake --build . --config Release -j $(nproc) - cmake --build . --config Release --target install - - name: package - run: | - tar -C build/install -zcvf libopencv_dart-windows-${{ matrix.arch }}.tar.gz . - - uses: actions/upload-artifact@v4 - name: upload - with: - path: libopencv_dart-windows-${{ matrix.arch }}.tar.gz - name: libopencv_dart-windows-${{ matrix.arch }}.tar.gz - - uses: robinraju/release-downloader@v1.10 - with: - repository: "rainyl/opencv_dart" - tag: "dnn_test_files" - fileName: "models.zip" - out-file-path: "test/" - extract: true - - uses: subosito/flutter-action@v2 - with: - channel: "stable" - - name: test coverage - run: | - cd "${{github.workspace}}" - ls windows - $env:PATH="${{github.workspace}}\windows;$env:PATH" - dart pub global activate coverage - dart pub global run coverage:test_with_coverage --package . --package-name opencv_dart - - name: Upload to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: rainyl/opencv_dart - file: ./coverage/lcov.info - - name: release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - prerelease: false - files: | - libopencv_dart-windows-${{ matrix.arch }}.tar.gz