Setup E2E test using NATS Backend #30
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 Test | |
on: | |
pull_request: | |
branches: | |
- main | |
- "release-*" | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- "sec-scanners-config.yaml" | |
env: | |
MANAGER_IMAGE: europe-docker.pkg.dev/kyma-project/prod/eventing-manager:latest | |
EPP_IMAGE: europe-docker.pkg.dev/kyma-project/dev/eventing-publisher-proxy:PR-${{ github.event.number }} | |
jobs: | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout EPP repository | |
uses: actions/checkout@v4 | |
with: | |
path: main | |
- name: Checkout EM repository | |
uses: actions/checkout@v4 | |
with: | |
repository: kyma-project/eventing-manager | |
path: eventing-manager | |
- name: Cache binaries | |
id: cache-binaries | |
uses: actions/cache@v3 | |
with: | |
path: bin | |
key: ${{ runner.os }}-bin | |
- name: Install k3d tools | |
run: | | |
make -C eventing-manager/hack/ci/ install-k3d-tools | |
- name: Install Kyma CLI & setup k3d cluster using kyma CLI | |
run: | | |
make -C eventing-manager kyma | |
make -C main/hack/ci/ create-k3d | |
kubectl version | |
kubectl cluster-info | |
- name: Create Namespace | |
run: | | |
kubectl create ns kyma-system | |
- name: Set Kyma CLI Variable | |
run: | | |
echo "KYMA_CLI=/home/runner/work/eventing-publisher-proxy/eventing-publisher-proxy/eventing-manager/bin/kyma-unstable" >> $GITHUB_ENV | |
- name: Setup NATS via Lifecycle Manager | |
run: | | |
make -C eventing-manager/hack/ci/ get-nats-via-lifecycle-manager | |
- name: Setup Eventing Manager | |
run: | | |
make -C eventing-manager install | |
- name: Deploy Eventing Manager | |
run: | | |
make -C eventing-manager deploy IMG=$MANAGER_IMAGE | |
- name: Wait for build job to succeed | |
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20 | |
with: | |
context: "pull-eventing-publisher-proxy-build" | |
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-publisher-proxy" | |
- name: Setup Eventing Manager with new EPP image | |
run: | | |
kubectl patch deployment eventing-manager -n kyma-system --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/env/8/value", "value": "${EPP_IMAGE}"}]' | |
- name: Create eventing CR and resources and check configuration | |
run: | # -> where do I get these scripts from? Code duplication? Importing? | |
make -C eventing-manager e2e-setup | |
- name: Setup subscriptions for testing | |
run: | | |
make -C eventing-manager e2e-eventing-setup | |
- name: Test eventing | |
run: | | |
make -C eventing-manager e2e-eventing | |
- name: On error get NATS CR | |
if: failure() | |
run: | | |
kubectl get nats -n kyma-system -o yaml | |
- name: On error get Eventing CR | |
if: failure() | |
run: | | |
kubectl get eventing -n kyma-system -o yaml |