Allow worker pods to restart on failures #1661
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: e2e | |
on: [pull_request] | |
env: | |
GO_VERSION: '1.20' | |
jobs: | |
build-operator-image: | |
runs-on: ubuntu-20.04 | |
name: Build the KMMO container image | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build the image | |
run: make docker-build IMG=kmm:local | |
- name: Export the image | |
run: docker save -o kmm_local.tar kmm:local | |
- name: Upload the image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ci-images | |
if-no-files-found: error | |
path: kmm_local.tar | |
retention-days: 1 | |
build-operator-hub-image: | |
runs-on: ubuntu-20.04 | |
name: Build the KMMO-hub container image | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build the image | |
run: make docker-build-hub HUB_IMG=kmm-hub:local | |
- name: Export the image | |
run: docker save -o kmm-hub_local.tar kmm-hub:local | |
- name: Upload the image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ci-images | |
if-no-files-found: error | |
path: kmm-hub_local.tar | |
retention-days: 1 | |
build-signing-image: | |
runs-on: ubuntu-20.04 | |
name: Build the signing image | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build the image | |
run: make signimage-build SIGNER_IMG=kmm-signimage:local | |
- name: Export the image | |
run: docker save -o kmm-signimage_local.tar kmm-signimage:local | |
- name: Upload the image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ci-images | |
if-no-files-found: error | |
path: kmm-signimage_local.tar | |
retention-days: 1 | |
build-worker-image: | |
runs-on: ubuntu-20.04 | |
name: Build the worker image | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build the image | |
run: make workerimage-build WORKER_IMG=kmm-worker:local | |
- name: Export the image | |
run: docker save -o kmm-worker_local.tar kmm-worker:local | |
- name: Upload the image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ci-images | |
if-no-files-found: error | |
path: kmm-worker_local.tar | |
retention-days: 1 | |
e2e: | |
strategy: | |
matrix: | |
include: | |
- name: e2e | |
env: | |
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci | |
script: ./ci/prow/e2e-incluster-build | |
- name: e2e-hub | |
env: | |
KUSTOMIZE_CONFIG_HUB_DEFAULT: ci/install-ci-hub | |
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci-spoke | |
import_hub_image: true | |
script: ./ci/prow/e2e-hub-spoke-incluster-build | |
runs-on: ubuntu-20.04 | |
name: ${{ matrix.name }} | |
needs: [build-operator-image, build-operator-hub-image, build-signing-image, build-worker-image] | |
services: | |
registry: | |
image: registry:2 | |
ports: ['5000:5000/tcp'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create the minikube cluster | |
uses: ./.github/actions/create-minikube-cluster | |
with: | |
start-args: --insecure-registry=host.minikube.internal:5000 | |
- name: Download container images | |
uses: actions/download-artifact@v3 | |
with: | |
name: ci-images | |
- name: Import the KMM operator image into minikube | |
run: minikube image load kmm_local.tar | |
- name: Import the KMM-hub operator image into minikube | |
run: minikube image load kmm-hub_local.tar | |
if: ${{ matrix.import_hub_image }} | |
- name: Copy the signing and worker images to the registry | |
run: | | |
docker load -i kmm-signimage_local.tar | |
docker load -i kmm-worker_local.tar | |
docker tag kmm-signimage:local localhost:5000/kmm/signimage:local | |
docker tag kmm-worker:local localhost:5000/kmm/worker:local | |
docker push localhost:5000/kmm/signimage:local | |
docker push localhost:5000/kmm/worker:local | |
- name: Set some Ubuntu environment variables | |
run: | | |
grep 'ID=' /etc/os-release >> "$GITHUB_ENV" | |
grep 'VERSION_ID=' /etc/os-release >> "$GITHUB_ENV" | |
- name: Cache binaries needed by Makefile | |
id: cache-bin | |
uses: actions/cache@v3 | |
with: | |
path: ./bin | |
key: ${{ runner.os }}-${{ env.ID }}-${{ env.VERSION_ID }}-bin-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }} | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
if: steps.cache-bin.outputs.cache-hit != 'true' | |
- name: Run test | |
run: ${{ matrix.script }} | |
env: | |
${{ matrix.env }} | |
- name: Collect troubleshooting data | |
uses: ./.github/actions/collect-troubleshooting | |
if: ${{ always() }} |