From c836cafffeae60a4c37be90f924a1d75a4f1b1d5 Mon Sep 17 00:00:00 2001 From: Alan Liddell Date: Thu, 1 Aug 2024 11:42:26 -0400 Subject: [PATCH 1/2] Remove Zarr submodule. Download and extract driver instead. Update acquire-common. Update test target. Remove automerge job. --- .github/workflows/test_pr.yml | 28 +-------------------------- .gitmodules | 4 ---- acquire-common | 2 +- tests/CMakeLists.txt | 36 +++++++++++++++++++++++++++++++++-- tests/acquire-driver-zarr | 1 - 5 files changed, 36 insertions(+), 35 deletions(-) delete mode 160000 tests/acquire-driver-zarr diff --git a/.github/workflows/test_pr.yml b/.github/workflows/test_pr.yml index 376f883..b1f7f83 100644 --- a/.github/workflows/test_pr.yml +++ b/.github/workflows/test_pr.yml @@ -4,7 +4,7 @@ on: push: branches: - main - pull_request_target: + pull_request: branches: - main @@ -59,29 +59,3 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build run: ctest -C ${{env.BUILD_TYPE}} -L acquire-driver-egrabber --output-on-failure - - merge: - name: Automerge - runs-on: "ubuntu-latest" - needs: test - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Checkout PR - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - name: Approve PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{ github.event.pull_request.html_url }} - GH_TOKEN: ${{ secrets.PAT }} - - # Don't auto-merge major version updates - - name: Merge PR - if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }} - run: gh pr merge --auto --squash "$PR_URL" - env: - PR_URL: ${{ github.event.pull_request.html_url }} - GH_TOKEN: ${{ secrets.PAT }} diff --git a/.gitmodules b/.gitmodules index 28a8d9e..7a9f600 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ [submodule "acquire-common"] path = acquire-common url = ../acquire-common.git -[submodule "tests/acquire-driver-zarr"] - path = tests/acquire-driver-zarr - url = ../acquire-driver-zarr.git - branch = main diff --git a/acquire-common b/acquire-common index 4444f5c..a5bb73d 160000 --- a/acquire-common +++ b/acquire-common @@ -1 +1 @@ -Subproject commit 4444f5c95f699e22b47e9a6e321359016faa03e6 +Subproject commit a5bb73d21642360a0dd5a395fe0736168df65842 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9e3384a..5de0f22 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,7 @@ else() set(NOTEST "TRUE") add_subdirectory(../acquire-common/acquire-driver-common ${CMAKE_CURRENT_BINARY_DIR}/acquire-driver-common) add_subdirectory(../acquire-common/acquire-video-runtime ${CMAKE_CURRENT_BINARY_DIR}/acquire-video-runtime) - aq_require(acquire-driver-zarr) + # aq_require(acquire-driver-zarr) set(NOTEST "FALSE") # @@ -50,7 +50,6 @@ else() foreach(driver acquire-driver-common acquire-driver-egrabber - acquire-driver-zarr ) add_custom_target(${project}-copy-${driver}-for-tests COMMAND ${CMAKE_COMMAND} -E copy @@ -64,4 +63,37 @@ else() add_dependencies(${tgt} ${project}-copy-${driver}-for-tests) endforeach() endforeach() + + # download the acquire-driver-zarr shared library to the tests directory + include(FetchContent) + + set(ZARR_RELEASE_URL "https://github.com/acquire-project/acquire-driver-zarr/releases/download") + set(ZARR_VERSION "0.1.12") + + if (WIN32) + set(ZARR_DRIVER_SUFFIX "win64") + elseif (APPLE) + set(ZARR_DRIVER_SUFFIX "Darwin") + elseif (UNIX) + set(ZARR_DRIVER_SUFFIX "Linux") + endif () + + FetchContent_Declare( + acquire_driver_zarr + URL "${ZARR_RELEASE_URL}/v${ZARR_VERSION}/acquire-driver-zarr-v${ZARR_VERSION}-${ZARR_DRIVER_SUFFIX}.zip" + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + ) + + FetchContent_MakeAvailable(acquire_driver_zarr) + set(ZARR_DRIVER_PATH ${acquire_driver_zarr_SOURCE_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}acquire-driver-zarr${CMAKE_SHARED_LIBRARY_SUFFIX}) + + add_custom_target(copy_zarr_driver + COMMAND ${CMAKE_COMMAND} -E copy + ${ZARR_DRIVER_PATH} + $ + DEPENDS ${ZARR_DRIVER_PATH} + COMMENT "Copying acquire-driver-zarr to $" + ) + + add_dependencies(${tgt} copy_zarr_driver) endif() diff --git a/tests/acquire-driver-zarr b/tests/acquire-driver-zarr deleted file mode 160000 index 901c3e4..0000000 --- a/tests/acquire-driver-zarr +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 901c3e4e781f0504bc6b9af21df418e154a783f7 From b13d684707c0123229fb8d7421b9d2908ef1be4c Mon Sep 17 00:00:00 2001 From: Alan Liddell Date: Thu, 1 Aug 2024 12:03:56 -0400 Subject: [PATCH 2/2] Update CMakeLists.txt --- tests/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5de0f22..e0f2f0f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,6 @@ else() set(NOTEST "TRUE") add_subdirectory(../acquire-common/acquire-driver-common ${CMAKE_CURRENT_BINARY_DIR}/acquire-driver-common) add_subdirectory(../acquire-common/acquire-video-runtime ${CMAKE_CURRENT_BINARY_DIR}/acquire-video-runtime) - # aq_require(acquire-driver-zarr) set(NOTEST "FALSE") #