From 53e2f2976754dc80da5d486598a75d309c488243 Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Thu, 2 Jan 2025 02:08:06 +0900 Subject: [PATCH] Install Kind by actions Signed-off-by: Yuki Iwai --- .github/workflows/main.yml | 6 +++++- test/e2e/e2e_suite_test.go | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2ee92518..d0b640b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,6 +46,10 @@ jobs: uses: actions/setup-go@v3 with: go-version-file: go.mod + - name: Setup kind + uses: helm/kind-action@v1.12.0 + with: + install_only: true - name: Run tests env: RELEASE_VERSION: test @@ -54,4 +58,4 @@ jobs: PLATFORMS: linux/amd64 INTEL_PLATFORMS: linux/amd64 MPICH_PLATFORMS: linux/amd64 - run: make test_e2e + run: make test_e2e -o kind diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 560256f6..e90797d5 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -142,7 +142,8 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte { var _ = ginkgo.SynchronizedAfterSuite(func() { if !useExistingCluster { ginkgo.By("Deleting local cluster") - err := runCommand(kindPath, "delete", "cluster") + err := runCommand("/opt/hostedtoolcache/kind/v0.26.0/amd64/kind/bin/kind", "delete", "cluster") + //err := runCommand(kindPath, "delete", "cluster") gomega.Expect(err).ToNot(gomega.HaveOccurred()) } else if !useExistingOperator { ginkgo.By("Uninstalling operator") @@ -160,11 +161,13 @@ func getEnvDefault(key, defaultVal string) string { } func bootstrapKindCluster() error { - err := runCommand(kindPath, "create", "cluster", "--image", kindImage) + err := runCommand("$/opt/hostedtoolcache/kind/v0.26.0/amd64/kind/bin/kind", "cluster", "--image", kindImage) + //err := runCommand(kindPath, "create", "cluster", "--image", kindImage) if err != nil { return fmt.Errorf("creating kind cluster: %w", err) } - err = runCommand(kindPath, "load", "docker-image", mpiOperatorImage, openMPIImage, intelMPIImage, mpichImage) + err = runCommand("/opt/hostedtoolcache/kind/v0.26.0/amd64/kind/bin/kind", "load", "docker-image", mpiOperatorImage, openMPIImage, intelMPIImage, mpichImage) + //err = runCommand(kindPath, "load", "docker-image", mpiOperatorImage, openMPIImage, intelMPIImage, mpichImage) if err != nil { return fmt.Errorf("loading container images: %w", err) }