-
Notifications
You must be signed in to change notification settings - Fork 140
135 lines (132 loc) · 4.84 KB
/
e2e-tests.yaml
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
name: E2E tests
on:
schedule:
# every work day at 00:00 UTC
- cron: 0 0 * * 1-5
workflow_dispatch:
inputs:
target:
description: 'Target branch to run E2E tests over'
required: true
default: 'main'
permissions:
checks: write
jobs:
run-in-k8s:
name: Run in Kubernetes latest (${{ github.event.inputs.target || 'main' }})
environment: E2E
env:
FLC_NAMESPACE: dto-daily
FLC_ENVIRONMENT: dto-k8s-latest-flc
TARGET_BRANCH: ${{ github.event.inputs.target || 'main' }}
TENANT1_NAME: ${{ secrets.TENANT1_NAME }}
TENANT1_APITOKEN: ${{ secrets.TENANT1_APITOKEN }}
TENANT1_OTELTOKEN: ${{ secrets.TENANT1_OTELTOKEN }}
TENANT1_OAUTH_CLIENT_ID: ${{ secrets.TENANT1_OAUTH_CLIENT_ID }}
TENANT1_OAUTH_SECRET: ${{ secrets.TENANT1_OAUTH_SECRET }}
TENANT2_NAME: ${{ secrets.TENANT2_NAME }}
TENANT2_APITOKEN: ${{ secrets.TENANT2_APITOKEN }}
runs-on:
- self-hosted
- operator-e2e
steps:
- name: Checkout workflow scripts from ref branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: ref
- name: Checkout target branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.inputs.target || 'main' }}
path: target
- name: Set up kubectl
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0
- name: Set up go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "${{ github.workspace }}/target/go.mod"
- name: Set up helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Create cluster
run: ref/.github/scripts/create-cluster.sh
- name: Run tests
run: ref/.github/scripts/run-e2e-tests.sh
- name: Destroy cluster
run: ref/.github/scripts/destroy-cluster.sh
if: always()
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: target/results/*.xml
if: always()
run-in-ocp:
name: Run in OpenShift latest (${{ github.event.inputs.target || 'main' }})
environment: E2E
env:
FLC_NAMESPACE: dto-daily
FLC_ENVIRONMENT: dto-ocp-latest-flc
TARGET_BRANCH: ${{ github.event.inputs.target || 'main' }}
TENANT1_NAME: ${{ secrets.TENANT1_NAME }}
TENANT1_APITOKEN: ${{ secrets.TENANT1_APITOKEN }}
TENANT1_OTELTOKEN: ${{ secrets.TENANT1_OTELTOKEN }}
TENANT1_OAUTH_CLIENT_ID: ${{ secrets.TENANT1_OAUTH_CLIENT_ID }}
TENANT1_OAUTH_SECRET: ${{ secrets.TENANT1_OAUTH_SECRET }}
TENANT2_NAME: ${{ secrets.TENANT2_NAME }}
TENANT2_APITOKEN: ${{ secrets.TENANT2_APITOKEN }}
runs-on:
- self-hosted
- operator-e2e
steps:
- name: Checkout workflow scripts from ref branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: ref
- name: Checkout target branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.inputs.target || 'main' }}
path: target
- name: Set up kubectl
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0
- name: Set up go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "${{ github.workspace }}/target/go.mod"
- name: Set up helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Create cluster
run: ref/.github/scripts/create-cluster.sh
- name: Run tests
run: ref/.github/scripts/run-e2e-tests.sh
- name: Destroy cluster
run: ref/.github/scripts/destroy-cluster.sh
if: always()
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: target/results/*.xml
if: always()
notify-failure:
name: Notify failure in Slack
environment: E2E
needs: ["run-in-k8s", "run-in-ocp"]
if: ${{ failure() || cancelled() }}
runs-on:
- self-hosted
- operator-e2e
steps:
- name: Notify failure in Slack
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
channel-id: 'int-cp-operator'
slack-message: ":x: E2E tests failed on ${{ github.event.inputs.target || 'main' }} branch (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}