Use go.work for CI workflows

This commit is contained in:
katexochen 2022-09-12 17:37:07 +02:00 committed by Paul Meyer
parent ddabf974d5
commit ebd9472866
3 changed files with 11 additions and 7 deletions

View File

@ -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 }}

View File

@ -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

View File

@ -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)