forked from eclipse-edc/MinimumViableDataspace
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (121 loc) · 4.63 KB
/
run-e2e-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#
# 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: "Execute E2E Tests"
on:
push:
pull_request:
branches:
- main
schedule:
- cron: "0 5 * * *" # once a 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:
Run-E2E-Tests:
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
- name: "Setup Terraform"
uses: hashicorp/setup-terraform@v3
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Build runtime images"
working-directory: ./
run: |
./gradlew -Ppersistence=true dockerize
- name: "Create k8s Kind Cluster"
uses: helm/[email protected]
with:
config: deployment/kind.config.yaml
cluster_name: dcp-demo
- name: "Load runtime images into KinD"
run: kind load docker-image controlplane:latest dataplane:latest identity-hub:latest catalog-server:latest sts:latest -n dcp-demo
- 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: "Terraform init"
working-directory: ./deployment
run: |-
terraform init -reconfigure
- name: "Terraform plan"
working-directory: ./deployment
run: |-
terraform plan -out=$GITHUB_SHA.out
- name: "Terraform apply"
working-directory: ./deployment
run: |-
terraform apply "$GITHUB_SHA.out"
- name: "Seed dataspace"
run: |-
chmod +x seed-k8s.sh
./seed-k8s.sh
- name: "Run E2E Test"
run: |-
./gradlew -DincludeTags="EndToEndTest" test -DverboseTest=true
- name: "Run Newman"
continue-on-error: true
working-directory: ./deployment/postman
run: |-
newman run "MVD.postman_collection.json" -e "MVD K8S.postman_environment.json" --folder "ControlPlane Management" --delay-request 5000 --verbose
- name: "Print log if test failed"
if: failure()
run: |-
kubectl logs deployment/provider-qna-controlplane -n mvd
- name: "Destroy the KinD cluster"
run: >-
kind delete cluster -n dcp-demo
Secrets-Presence:
name: "Check for required credentials"
runs-on: ubuntu-latest
outputs:
HAS_WEBHOOK: ${{ steps.secrets-presence.outputs.HAS_WEBHOOK }}
steps:
- name: Check whether secrets exist
id: secrets-presence
run: |
[ ! -z "${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}" ] && echo "HAS_WEBHOOK=true" >> $GITHUB_OUTPUT
exit 0
Post-To-Discord:
needs: [ Run-E2E-Tests, Secrets-Presence ]
if: "needs.Secrets-Presence.outputs.HAS_WEBHOOK && always() && github.event_name == 'schedule'"
runs-on: ubuntu-latest
steps:
- uses: sarisia/actions-status-discord@v1
name: "Post discord webhook"
with:
webhook: ${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}
# if the publishing is skipped, that means the preceding test run failed
status: ${{ needs.Run-E2E-Tests.result == 'skipped' && 'Failure' || needs.Run-E2E-Tests.result }}
title: "Nightly MVD E2E-Test"
description: Nightly E2E test run against the latest artefacts"
username: GitHub Actions