Skip to content

Commit

Permalink
feat(ci): Add a separate workflow for running operator upgrade scenario
Browse files Browse the repository at this point in the history
Signed-off-by: vprashar2929 <vibhu.sharma2929@gmail.com>
  • Loading branch information
vprashar2929 committed Jul 31, 2024
1 parent ac1c1fd commit fb6b454
Show file tree
Hide file tree
Showing 3 changed files with 427 additions and 324 deletions.
26 changes: 26 additions & 0 deletions .github/operator-upgrade/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Operator Upgrade Test
description: Runs operator upgrade scenario
runs:
using: composite
steps:
- name: Checkout source
uses: actions/checkout@v3

- uses: actions/setup-go@main
with:
go-version-file: go.mod
check-latest: true
cache: true

- name: Install all tools
uses: ./.github/tools-cache

- uses: ./.github/compute-version
id: version

- name: Run Operator Upgrade
shell: bash
run: |
./tests/run-e2e.sh --ci
env:
VERSION: ${{ steps.version.outputs.version }}
60 changes: 58 additions & 2 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,64 @@ jobs:
version: ${{ steps.version.outputs.version }}
additional_tags: ${{ steps.additional_tags.outputs.result }}

e2e:
operator-upgrade:
needs: [docs, golangci, fmt, vulnerability_detect, escapes_detect]
env:
KIND_VERSION: "0.15.0"
GO111MODULE: "on"
OPERATOR_IMAGE: "quay.io/sustainable_computing_io/kepler-operator"
KUBECONFIG: /tmp/.kube/config
KIND_WORKER_NODES: 2

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
go-version-file: go.mod

- name: Install Go
uses: actions/setup-go@main
with:
go-version-file: go.mod

- name: Install all tools
uses: ./.github/tools-cache

- name: use kepler action for kind cluster build
uses: sustainable-computing-io/kepler-action@v0.0.5
with:
ebpfprovider: libbpf
cluster_provider: kind
env:
PROMETHEUS_ENABLE: "false"

- name: Ensure cluster is able to run OLM bundles
run: make cluster-prereqs

- name: Run operator upgrade test
uses: ./.github/operator-upgrade

- name: Capture cluster state
if: always()
shell: bash
run: |
# Capture apiserver state
# TODO: enable this when we have oc installed as part of `make tools`
# oc adm inspect node --dest-dir cluster-state || true
# oc adm inspect -A statefulset --dest-dir cluster-state || true
# oc adm inspect -A deployment --dest-dir cluster-state || true
# oc adm inspect -A ns --dest-dir cluster-state || true
cp -r tmp/e2e cluster-state/ || true
- name: Archive production artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: cluster-state
path: cluster-state

e2e:
needs: [docs, golangci, fmt, vulnerability_detect, escapes_detect, operator-upgrade]
env:
KIND_VERSION: "0.15.0"
GO111MODULE: "on"
Expand Down Expand Up @@ -172,7 +228,7 @@ jobs:
- name: Run e2e tests
run: |
./tests/run-e2e.sh --ci
./tests/run-e2e.sh --ci --no-upgrade
env:
VERSION: ${{ steps.version.outputs.version }}

Expand Down
Loading

0 comments on commit fb6b454

Please sign in to comment.