diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fd3e702..b9c87d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,6 +28,8 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - run: go version diff --git a/.github/workflows/test-e2e-helm.yml b/.github/workflows/test-e2e-helm.yml index a6afd1c..20fe347 100644 --- a/.github/workflows/test-e2e-helm.yml +++ b/.github/workflows/test-e2e-helm.yml @@ -18,6 +18,7 @@ permissions: {} env: HELM_CHART_PATH: charts/lifecycle-controller + KIND_VERSION: v0.32.0 jobs: test-e2e-helm: @@ -32,6 +33,8 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - run: go version @@ -47,11 +50,11 @@ jobs: - run: helm version - - name: Install latest kind release - run: | - curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind + - name: Set up kind + uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 + with: + install_only: true + version: ${{ env.KIND_VERSION }} - name: Run Helm E2E tests run: | diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 0e55dab..d589b3c 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -19,9 +19,28 @@ on: - 'test/e2e/**' - 'test/utils/**' - '.github/workflows/test-e2e.yml' + push: + branches: + - main + paths: + - '**.go' + - 'go.mod' + - 'go.sum' + - 'internal/**' + - 'cmd/**' + - 'api/**' + - 'Dockerfile' + - 'Makefile' + - 'config/**' + - 'test/e2e/**' + - 'test/utils/**' + - '.github/workflows/test-e2e.yml' permissions: {} +env: + KIND_VERSION: v0.32.0 + jobs: test-e2e: permissions: @@ -35,15 +54,17 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - run: go version - - name: Install latest kind release - run: | - curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind + - name: Set up kind + uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 + with: + install_only: true + version: ${{ env.KIND_VERSION }} - name: Verify kind installation run: kind version diff --git a/.github/workflows/test-helm-unittest.yml b/.github/workflows/test-helm-unittest.yml index 7e17c57..6f4fddc 100644 --- a/.github/workflows/test-helm-unittest.yml +++ b/.github/workflows/test-helm-unittest.yml @@ -10,11 +10,19 @@ on: - 'charts/**' - 'Makefile' - '.github/workflows/test-helm-unittest.yml' + push: + branches: + - main + paths: + - 'charts/**' + - 'Makefile' + - '.github/workflows/test-helm-unittest.yml' permissions: {} env: HELM_CHART_PATH: charts/lifecycle-controller + HELM_UNITTEST_VERSION: v1.1.1 jobs: helm-unittest: @@ -39,7 +47,11 @@ jobs: - run: helm version - name: Install helm-unittest plugin - run: helm plugin install https://github.com/helm-unittest/helm-unittest --verify=false + run: | + if [ ! -d "$(helm env HELM_PLUGINS)/helm-unittest" ]; then + helm plugin install https://github.com/helm-unittest/helm-unittest \ + --version "$HELM_UNITTEST_VERSION" --verify=false + fi - name: Run Helm unit tests run: make helm-unittest HELM_CHART_PATH=${{ env.HELM_CHART_PATH }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6f8654..f6d640f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,15 @@ on: - 'go.mod' - 'go.sum' - '.github/workflows/test.yml' + push: + branches: + - main + paths: + - '**.go' + - 'go.mod' + - 'go.sum' + - 'Makefile' + - '.github/workflows/test.yml' permissions: {} @@ -27,6 +36,8 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - run: go version