Run E2E Tests #204
This file contains hidden or 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
| # | |
| # Copyright (c) 2025 Metaform Systems, Inc. | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Apache License, Version 2.0 which is available at | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| # Contributors: | |
| # Metaform Systems, Inc. - initial API and implementation | |
| # | |
| --- | |
| name: "Run E2E Tests" | |
| on: | |
| push: | |
| pull_request: | |
| workflow_run: | |
| workflows: [ "Draft Release" ] | |
| types: | |
| - completed | |
| schedule: | |
| - cron: '0 3 * * *' # Run at 3am UTC every day | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| E2E-Tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: eclipse-edc/.github/.github/actions/setup-build@main | |
| - name: "Setup Kubectl" | |
| uses: azure/setup-kubectl@v4 | |
| - name: "Build runtime images" | |
| run: | | |
| ./gradlew dockerize | |
| docker buildx build -f launchers/postgres/Dockerfile -t ghcr.io/metaform/jad/postgres:wal2json launchers/postgres | |
| - name: "Create k8s Kind Cluster" | |
| uses: helm/kind-action@v1.13.0 | |
| with: | |
| config: kind.config.yaml | |
| cluster_name: jad | |
| - name: "Load runtime images into KinD" | |
| run: | | |
| kind load docker-image -n jad ghcr.io/metaform/jad/postgres:wal2json \ | |
| ghcr.io/metaform/jad/controlplane:latest \ | |
| ghcr.io/metaform/jad/dataplane:latest \ | |
| ghcr.io/metaform/jad/identity-hub:latest \ | |
| ghcr.io/metaform/jad/issuerservice:latest \ | |
| - name: "Install nginx ingress controller" | |
| run: |- | |
| kubectl apply -f https://kind.sigs.k8s.io/examples/ingress/deploy-ingress-nginx.yaml | |
| kubectl wait --namespace ingress-nginx \ | |
| --for=condition=ready pod \ | |
| --selector=app.kubernetes.io/component=controller \ | |
| --timeout=120s | |
| sleep 5 # to be safe | |
| - name: "Deploy JAD infrastructure" | |
| run: | | |
| # deploying the infrastructure first, wait for it to finish and deploying the applications afterwards is | |
| # the safest way to avoid race conditions between apps and infra, e.g. vault. | |
| kubectl apply -f k8s/base | |
| - name: "Wait for JAD infrastructure to be ready" | |
| run: |- | |
| kubectl wait --namespace edc-v \ | |
| --for=condition=ready pod \ | |
| --selector=type=edcv-infra \ | |
| --timeout=120s | |
| - name: "Deploy JAD applications" | |
| run: |- | |
| # this is crucial - without it, KinD would take the prebuilt images from GHCR | |
| sed -i "s/imagePullPolicy:.*Always/imagePullPolicy: Never/g" k8s/apps/controlplane.yaml | |
| sed -i "s/imagePullPolicy:.*Always/imagePullPolicy: Never/g" k8s/apps/dataplane.yaml | |
| sed -i "s/imagePullPolicy:.*Always/imagePullPolicy: Never/g" k8s/apps/issuerservice.yaml | |
| sed -i "s/imagePullPolicy:.*Always/imagePullPolicy: Never/g" k8s/apps/identityhub.yaml | |
| kubectl apply -f k8s/apps | |
| - name: "Wait for JAD applications to be ready" | |
| run: |- | |
| # wait until all init jobs are done | |
| kubectl wait --namespace edc-v \ | |
| --selector=type=edcv-job \ | |
| --for=condition=complete job --all \ | |
| --timeout=120s | |
| - name: "Run E2E Test" | |
| run: | | |
| ./gradlew test -DincludeTags="EndToEndTest" | |
| - name: "Print log if test failed" | |
| if: failure() | |
| run: |- | |
| kubectl logs deployment/controlplane -n edc-v | |
| kubectl logs deployment/dataplane -n edc-v | |
| - name: "Destroy the KinD cluster" | |
| run: >- | |
| kind delete cluster -n jad |