Run E2E Tests #66
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
# | |
# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft | |
# | |
# See the NOTICE file(s) distributed with this work for additional | |
# information regarding copyright ownership. | |
# | |
# 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 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations | |
# under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
--- | |
name: "Run E2E Tests" | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [ "Verify" ] | |
types: | |
- completed | |
jobs: | |
Deploy-with-Terraform: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Setup Helm" | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.8.1 | |
- name: "Setup Kubectl" | |
uses: azure/setup-kubectl@v4 | |
- uses: actions/checkout@v4 | |
- name: "Create k8s Kind Cluster" | |
uses: helm/[email protected] | |
with: | |
config: mxd/kind.config.yaml | |
cluster_name: mxd | |
- name: "Install nginx ingress controller" | |
run: |- | |
echo "::notice title=nginx ingress on KinD::For details how to run nginx ingress on KinD check https://kind.sigs.k8s.io/docs/user/ingress/#ingress-nginx" | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | |
kubectl wait --namespace ingress-nginx \ | |
--for=condition=ready pod \ | |
--selector=app.kubernetes.io/component=controller \ | |
--timeout=90s | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: "Build Runtime Docker Images" | |
working-directory: mxd-runtimes | |
run: |- | |
./gradlew clean dockerize | |
- name: "Load Docker Images" | |
run: |- | |
kind load docker-image --name mxd data-service-api tx-identityhub tx-identityhub-sts tx-catalog-server tx-sts | |
- name: "Terraform init" | |
working-directory: mxd | |
run: |- | |
terraform init -reconfigure | |
- name: "Terraform plan" | |
working-directory: mxd | |
run: |- | |
terraform plan -out=$GITHUB_SHA.out | |
- name: "Terraform apply" | |
working-directory: mxd | |
run: |- | |
terraform apply "$GITHUB_SHA.out" | |
- name: "Run Health Checks" | |
run: |- | |
curl --fail http://localhost/bob/health/api/check/readiness | |
curl --fail http://localhost/alice/health/api/check/readiness | |
- name: "Run E2E Tests" | |
working-directory: mxd-runtimes | |
run: |- | |
./gradlew :e2e-test:test -DrunAllTests=true -PverboseTest=true | |
- name: "Destroy the KinD cluster" | |
run: >- | |
kind get clusters | xargs -n1 kind delete cluster --name |