diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 9bb0e359a0..d5e2b76cc8 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -27,18 +27,44 @@ jobs: - "sample-operators/operations" - "sample-operators/kotlin-operator" runs-on: ubuntu-latest + env: + MINIKUBE_VERSION: v1.39.0 + # Use the latest versions supported by minikube, otherwise GitHub it will + # end up in a throttling requests from minikube and workflow will fail. + # Minikube does such requests only if a version is not officially supported. + KUBERNETES_VERSION: v1.37.0 steps: - name: Checkout uses: actions/checkout@v7 + # minikube downloads its base image and the preloaded Kubernetes images on every start, + # which regularly times out when many matrix jobs start at once + - name: Cache Minikube downloads + uses: actions/cache@v6 + with: + path: ${{ runner.temp }}/.minikube/cache + key: minikube-${{ runner.os }}-${{ env.MINIKUBE_VERSION }}-${{ env.KUBERNETES_VERSION }}-docker + - name: Setup Minikube-Kubernetes + id: minikube + continue-on-error: true + uses: manusa/actions-setup-minikube@v2.19.0 + with: + minikube version: ${{ env.MINIKUBE_VERSION }} + kubernetes version: ${{ env.KUBERNETES_VERSION }} + github token: ${{ secrets.GITHUB_TOKEN }} + driver: docker + + - name: Clean up failed Minikube setup + if: steps.minikube.outcome == 'failure' + run: '"$MINIKUBE_HOME/minikube" delete || true' + + - name: Setup Minikube-Kubernetes (retry) + if: steps.minikube.outcome == 'failure' uses: manusa/actions-setup-minikube@v2.19.0 with: - minikube version: 'v1.39.0' - # Use the latest versions supported by minikube, otherwise GitHub it will - # end up in a throttling requests from minikube and workflow will fail. - # Minikube does such requests only if a version is not officially supported. - kubernetes version: 'v1.37.0' + minikube version: ${{ env.MINIKUBE_VERSION }} + kubernetes version: ${{ env.KUBERNETES_VERSION }} github token: ${{ secrets.GITHUB_TOKEN }} driver: docker diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 31f69ec5e4..3f1353efea 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -28,6 +28,8 @@ jobs: runs-on: ubuntu-latest continue-on-error: ${{ inputs.experimental }} timeout-minutes: 120 + env: + MINIKUBE_VERSION: v1.39.0 steps: - uses: actions/checkout@v7 with: @@ -38,10 +40,29 @@ jobs: distribution: temurin java-version: ${{ inputs.java-version }} cache: 'maven' + # minikube downloads kubelet, kubeadm and kubectl from dl.k8s.io on every start, which + # regularly times out when many matrix jobs start at once + - name: Cache Minikube downloads + uses: actions/cache@v6 + with: + path: ${{ runner.temp }}/.minikube/cache + key: minikube-${{ runner.os }}-${{ env.MINIKUBE_VERSION }}-${{ inputs.kube-version }}-none - name: Set up Minikube + id: minikube + continue-on-error: true + uses: manusa/actions-setup-minikube@v2.19.0 + with: + minikube version: ${{ env.MINIKUBE_VERSION }} + kubernetes version: '${{ inputs.kube-version }}' + github token: ${{ github.token }} + - name: Clean up failed Minikube setup + if: steps.minikube.outcome == 'failure' + run: sudo -E --preserve-env=HOME,MINIKUBE_HOME "$MINIKUBE_HOME/minikube" delete || true + - name: Set up Minikube (retry) + if: steps.minikube.outcome == 'failure' uses: manusa/actions-setup-minikube@v2.19.0 with: - minikube version: 'v1.39.0' + minikube version: ${{ env.MINIKUBE_VERSION }} kubernetes version: '${{ inputs.kube-version }}' github token: ${{ github.token }}