diff --git a/.github/workflows/pre-main.yaml b/.github/workflows/pre-main.yaml index 3358a9a..4548503 100644 --- a/.github/workflows/pre-main.yaml +++ b/.github/workflows/pre-main.yaml @@ -35,10 +35,17 @@ jobs: - name: Disable default go problem matcher run: echo "::remove-matcher owner=go::" - - name: Check out code + - name: Check out l2discovery-lib code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ github.sha }} + + - name: Check out l2discovery-examples code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + repository: redhat-cne/graphsolver-examples + ref: main + path: examples - name: Extract dependent Pull Requests uses: depends-on/depends-on-action@9e8a61fce18b15281e831f1bba0e14c71d1e1f46 # main @@ -72,8 +79,8 @@ jobs: run: make build env: SHELL: /bin/bash - - - name: Run Tests + + - name: Run examples cluster tests with this latest l2discovery-lib code run: make test env: SHELL: /bin/bash diff --git a/Makefile b/Makefile index 9935552..8bb96ca 100644 --- a/Makefile +++ b/Makefile @@ -9,3 +9,5 @@ install-lint: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GO_PATH}/bin ${GOLANGCI_VERSION} vet: go vet ${GO_PACKAGES} +test: + ./scripts/test.sh diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..be35e5d --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o nounset -o pipefail + +# CD in the examples repo +cd examples || exit + +# Get latest changes +echo "replace github.com/redhat-cne/l2discovery-lib => .." >>go.mod +go mod tidy +go mod vendor + +# Test them in examples repository +make test