diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index d49d862cc..4db5b71e2 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -39,10 +39,17 @@ jobs: go-version: "1.19.1" cache: true + - name: Get Go submodules + id: submods + shell: bash + run: | + mods=$(go list -f '{{.Dir}}/...' -m | xargs) + echo "Found mods: $mods" + echo "::set-output name=submods::${mods}" + - name: golangci-lint uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc with: skip-pkg-cache: true skip-build-cache: true - working-directory: ./... ./hack/... ./operators/constellation-node-operator/... - args: --timeout=15m + args: --timeout=15m ${{ steps.submods.outputs.submods }} diff --git a/.github/workflows/test-unittest.yml b/.github/workflows/test-unittest.yml index 2bf681433..bae66e463 100644 --- a/.github/workflows/test-unittest.yml +++ b/.github/workflows/test-unittest.yml @@ -38,7 +38,6 @@ jobs: - name: Create and populate build folder run: mkdir build && cd build && cmake .. - # Runs all test targets starting with "unit-" - name: Unit Tests - run: ctest -j $(nproc) -R unit- + run: ctest -j $(nproc) -R unit working-directory: build diff --git a/CMakeLists.txt b/CMakeLists.txt index 798f2da35..48c7df21d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,9 +58,7 @@ add_custom_target(cdbg ALL BYPRODUCTS cdbg ) -add_test(NAME unit-main COMMAND go test -race -count=3 ./... WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) -add_test(NAME unit-hack COMMAND go test -race -count=3 ./... WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/hack) -add_test(NAME unit-node-operator COMMAND go test -race -count=3 ./... WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/operators/constellation-node-operator) +add_test(NAME unit COMMAND bash -c "go test -race -count=3 $(go list -f '{{.Dir}}/...' -m | xargs)" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_test(NAME integration-node-operator COMMAND make test WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/operators/constellation-node-operator) add_test(NAME integration-csi COMMAND bash -c "go test -tags integration -c ./test/ && sudo ./test.test -test.v" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/csi) add_test(NAME integration-dm COMMAND bash -c "go test -tags integration -c ./test/ && sudo ./test.test -test.v" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/disk-mapper/internal)