1
0
mirror of https://github.com/coreos/prometheus-operator.git synced 2026-02-05 06:45:27 +01:00

Merge pull request #7577 from V0YD23/reusable_e2e

Reusable e2e workflow added
This commit is contained in:
Yash Dugriyal
2025-06-10 18:33:01 +05:30
committed by GitHub
parent c4ebc762d0
commit 2f0f941b09
4 changed files with 68 additions and 105 deletions

54
.github/actions/setup-e2e/action.yaml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: E2E Setup
description: Common setup for E2E tests
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Import environment variables from file
run: |
cat ".github/env" >> "$GITHUB_ENV"
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
shell: bash
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ env.golang-version }}'
check-latest: true
- name: Build images
run: |
export SHELL="/bin/bash"
make build image
shell: bash
- name: Start kind cluster
uses: helm/kind-action@v1.12.0
with:
version: ${{ env.kind-version }}
node_image: ${{ env.kind-image }}
wait: 300s
config: ./test/e2e/kind-conf.yaml
cluster_name: e2e
- name: Wait for cluster to finish bootstrapping
run: |
echo "Waiting for all nodes to be ready..."
kubectl wait --for=condition=Ready nodes --all --timeout=120s
kubectl get nodes
echo "Waiting for all pods to be ready..."
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
kubectl get pods -A
echo "Cluster information"
kubectl cluster-info
shell: bash
- name: Load images
run: |
make test-e2e-images
kubectl apply -f scripts/kind-rbac.yaml
shell: bash

View File

@@ -23,41 +23,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Import environment variables from file
run: |
cat ".github/env" >> "$GITHUB_ENV"
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ env.golang-version }}'
check-latest: true
- name: Build images
run: |
export SHELL=/bin/bash
make build image
- name: Start kind cluster
uses: helm/kind-action@v1.12.0
with:
version: ${{ env.kind-version }}
node_image: ${{ env.kind-image }}
wait: 300s
config: ./test/e2e/kind-conf.yaml
cluster_name: e2e
- name: Wait for cluster to finish bootstraping
run: |
echo "Waiting for all nodes to be ready..."
kubectl wait --for=condition=Ready nodes --all --timeout=120s
kubectl get nodes
echo "Waiting for all pods to be ready..."
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
kubectl get pods -A
echo "Cluster information"
kubectl cluster-info
- name: Load images
run: |
make test-e2e-images
kubectl apply -f scripts/kind-rbac.yaml
- name: Setup E2E environment
uses: ./.github/actions/setup-e2e # composite action with your setup steps
- name: Run tests
env:
E2E_DIAGNOSTIC_DIRECTORY: ${{ env.E2E_DIAGNOSTIC_DIRECTORY }}

View File

@@ -28,41 +28,11 @@ jobs:
target: test-e2e-operator-upgrade
steps:
- uses: actions/checkout@v4
- name: Import environment variables from file
run: |
cat ".github/env" >> "$GITHUB_ENV"
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ env.golang-version }}'
check-latest: true
- name: Build images
run: |
export SHELL="/bin/bash"
make build image
- name: Start kind cluster
uses: helm/kind-action@v1.12.0
with:
version: ${{ env.kind-version }}
node_image: ${{ env.kind-image }}
wait: 300s
config: ./test/e2e/kind-conf.yaml
cluster_name: e2e
- name: Wait for cluster to finish bootstraping
run: |
echo "Waiting for all nodes to be ready..."
kubectl wait --for=condition=Ready nodes --all --timeout=120s
kubectl get nodes
echo "Waiting for all pods to be ready..."
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
kubectl get pods -A
echo "Cluster information"
kubectl cluster-info
- name: Load images
run: |
make test-e2e-images
kubectl apply -f scripts/kind-rbac.yaml
- name: Setup E2E environment
uses: ./.github/actions/setup-e2e # composite action with your setup steps
- name: Run tests
env:
E2E_DIAGNOSTIC_DIRECTORY: ${{ env.E2E_DIAGNOSTIC_DIRECTORY }}

View File

@@ -7,6 +7,7 @@ on:
- 'release-*'
- 'master'
- 'main'
- 'reusable_e2e'
tags:
- 'v*'
# To cancel running workflow when new commits pushed in a pull request
@@ -37,41 +38,10 @@ jobs:
target: test-e2e-operator-upgrade
steps:
- uses: actions/checkout@v4
- name: Import environment variables from file
run: |
cat ".github/env" >> "$GITHUB_ENV"
echo "E2E_DIAGNOSTIC_DIRECTORY=$(mktemp -d)" >> "$GITHUB_ENV"
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ env.golang-version }}'
check-latest: true
- name: Build images
run: |
export SHELL="/bin/bash"
make build image
- name: Start kind cluster
uses: helm/kind-action@v1.12.0
with:
version: ${{ env.kind-version }}
node_image: ${{ env.kind-image }}
wait: 300s
config: ./test/e2e/kind-conf.yaml
cluster_name: e2e
- name: Wait for cluster to finish bootstraping
run: |
echo "Waiting for all nodes to be ready..."
kubectl wait --for=condition=Ready nodes --all --timeout=120s
kubectl get nodes
echo "Waiting for all pods to be ready..."
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
kubectl get pods -A
echo "Cluster information"
kubectl cluster-info
- name: Load images
run: |
make test-e2e-images
kubectl apply -f scripts/kind-rbac.yaml
- name: Setup E2E environment
uses: ./.github/actions/setup-e2e # composite action with your setup steps
- name: Run tests
env:
E2E_DIAGNOSTIC_DIRECTORY: ${{ env.E2E_DIAGNOSTIC_DIRECTORY }}