generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use for PR ugprade job * Use for main merge upgrade job
- Loading branch information
Showing
3 changed files
with
219 additions
and
85 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: post-e2e-upgrade-test | ||
|
||
env: | ||
DOCKER_IMAGE: "europe-docker.pkg.dev/kyma-project/prod/eventing-manager" | ||
DOCKER_IMAGE_LATEST_RELEASE: europe-docker.pkg.dev/kyma-project/dev/eventing-manager:1.0.3 | ||
E2E_LOG_LEVEL: debug | ||
KYMA_STABILITY: "unstable" | ||
KYMA: "./hack/kyma" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
- 'sec-scanners-config.yaml' | ||
|
||
jobs: | ||
e2e-upgrade: # This job tests the upgrade of Eventing module from latest image of the main branch to the current commit. | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_TYPE: NATS | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install k3d tools | ||
run: | | ||
make -C hack/ci/ install-k3d-tools | ||
- name: Install Kyma CLI & setup k3d cluster using kyma CLI | ||
run: | | ||
make kyma | ||
make -C hack/ci/ create-k3d | ||
kubectl version | ||
kubectl cluster-info | ||
- name: Create kyma-system namespace | ||
run: | | ||
make -C hack/ci/ create-kyma-system-ns | ||
- name: Install the latest released NATS manager | ||
run: | | ||
kubectl apply -f https://github.com/kyma-project/nats-manager/releases/latest/download/nats-manager.yaml | ||
kubectl apply -f https://github.com/kyma-project/nats-manager/releases/latest/download/nats-default-cr.yaml | ||
- name: Wait for NATS module to be ready | ||
run: | | ||
while [[ $(kubectl get -n kyma-system nats eventing-nats -o jsonpath='{.status.state}') != "Ready" ]]; do | ||
echo "waiting for NATS module to be ready" | ||
sleep 3 | ||
done | ||
echo "NATS module is ready!" | ||
- name: Install the latest released Eventing manager | ||
run: | | ||
kubectl apply -f https://github.com/kyma-project/eventing-manager/releases/latest/download/eventing-manager.yaml | ||
- name: Setup & test Eventing CR | ||
run: | | ||
export MANAGER_IMAGE=${DOCKER_IMAGE_LATEST_RELEASE} | ||
make e2e-setup | ||
- name: Wait for the 'post-eventing-manager-build' job to succeed | ||
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20 | ||
with: | ||
context: "post-eventing-manager-build" | ||
commit_ref: "${{ github.sha }}" | ||
timeout: 600000 # 10 minutes in milliseconds | ||
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting) | ||
check_interval: 60000 # 1 minute in milliseconds | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_OWNER: "${{ github.repository_owner }}" | ||
GITHUB_REPO: "eventing-manager" | ||
|
||
- name: Install the new Eventing manager from current commit | ||
run: | | ||
export DOCKER_TAG="$(date +v%Y%m%d)-$(echo ${COMMIT_SHA} | head -c 8)" | ||
export MANAGER_IMAGE="${DOCKER_IMAGE}:${DOCKER_TAG}" | ||
make deploy IMG="${DOCKER_IMAGE}:${DOCKER_TAG}" | ||
- name: Wait for new changes to be reflected and create test resources | ||
# Waits for eventing-manager image to be updated and Eventing CR readiness. | ||
# Creates Subscription CRs for testing too. | ||
run: | | ||
export DOCKER_TAG="$(date +v%Y%m%d)-$(echo ${COMMIT_SHA} | head -c 8)" | ||
export MANAGER_IMAGE="${DOCKER_IMAGE}:${DOCKER_TAG}" | ||
make e2e-setup | ||
make e2e-eventing-setup | ||
- name: Run e2e tests | ||
run: | | ||
make e2e-eventing | ||
- name: Cleanup Test Resources | ||
run: | | ||
make e2e-eventing-cleanup | ||
make e2e-cleanup |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Upgrade Tests Reusable Workflow | ||
|
||
env: | ||
E2E_LOG_LEVEL: debug | ||
KYMA_STABILITY: "unstable" | ||
KYMA: "./hack/kyma" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
pre-upgrade-image: | ||
required: true | ||
type: string | ||
post-upgrade-image: | ||
required: true | ||
type: string | ||
pre-upgrade-branch: | ||
required: true | ||
type: string | ||
post-upgrade-branch: | ||
required: true | ||
type: string | ||
build-job-name: | ||
required: true | ||
type: string | ||
commit-sha: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
e2e-upgrade: # This job tests the upgrade of Eventing module from latest image of the main branch to the current commit. | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_TYPE: NATS | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.pre-upgrade-branch }} | ||
|
||
- name: Install k3d tools | ||
run: imagemake -C hack/ci/ install-k3d-tools | ||
|
||
- name: Install Kyma CLI & setup k3d cluster using kyma CLI | ||
run: | | ||
make kyma | ||
make -C hack/ci/ create-k3d | ||
kubectl version | ||
kubectl cluster-info | ||
- name: Create kyma-system namespace | ||
run: | | ||
make -C hack/ci/ create-kyma-system-ns | ||
- name: Install the latest released NATS manager | ||
run: | | ||
kubectl apply -f https://github.com/kyma-project/nats-manager/releases/latest/download/nats-manager.yaml | ||
kubectl apply -f https://github.com/kyma-project/nats-manager/releases/latest/download/nats-default-cr.yaml | ||
- name: Wait for NATS module to be ready | ||
run: | | ||
make -C hack/ci/ wait-nats-cr-ready | ||
- name: Install Eventing Manager before Upgrade | ||
run: | | ||
make deploy IMG=${{ inputs.pre-upgrade-image }} | ||
- name: Create test resources and waits for eventing CR readiness | ||
run: | | ||
export MANAGER_IMAGE=${{ inputs.pre-upgrade-image }} | ||
make e2e-setup | ||
make e2e-eventing-setup | ||
- name: Wait for the ${{ inputs.build-job-name }} job to succeed | ||
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20 | ||
with: | ||
context: ${{ inputs.build-job-name }} | ||
commit_ref: "${{ github.event.pull_request.head.sha }}" # Note: 'github.event.pull_request.head.sha' is not same as 'github.sha' on pull requests. | ||
timeout: 600000 # 10 minutes in milliseconds | ||
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting) | ||
check_interval: 60000 # 1 minute in milliseconds | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_OWNER: "${{ github.repository_owner }}" | ||
GITHUB_REPO: "eventing-manager" | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.post-upgrade-branch }} | ||
|
||
- name: Install Eventing manager after Upgrade | ||
run: | | ||
make deploy IMG=${{ inputs.post-upgrade-image }} | ||
- name: Create test resources and waits for eventing CR readiness | ||
run: | | ||
export MANAGER_IMAGE=${{ inputs.post-upgrade-image }} | ||
make e2e-setup | ||
- name: Run e2e tests | ||
run: | | ||
make e2e-eventing | ||
- name: Cleanup Test Resources | ||
run: | | ||
make e2e-eventing-cleanup | ||
make e2e-cleanup | ||