generated from cloudoperators/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (75 loc) · 2.58 KB
/
ci-e2e-test-nightly.yaml
File metadata and controls
81 lines (75 loc) · 2.58 KB
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
name: Nightly E2E Workflow
on:
workflow_dispatch:
schedule:
- cron: "0 1-6 * * *" # run hourly from 1am to 6am
jobs:
init:
outputs:
tests: ${{ steps.e2es.outputs.result }}
runs-on: [ ubuntu-latest ]
name: "Prepare E2E Scenarios"
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# find all e2e scenarios in the e2e directory and generate an array of scenario names
- name: "E2E Detection"
id: e2es
run: |
scenarios=$(find ${GITHUB_WORKSPACE}/e2e -type f -name 'e2e_test.go' -not -path "*/authz/*" -exec dirname {} \; | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')
echo $scenarios
echo "result=$scenarios" >> $GITHUB_OUTPUT
e2e:
name: "Run ${{ matrix.e2es }}(${{ matrix.k8s-version}}) E2E"
if: needs.init.outputs.tests != '[]'
needs: [ init ]
runs-on: [ ubuntu-latest ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
k8s-version: [ "v1.32.11", "v1.33.7", "v1.34.3" ]
e2es: ${{fromJson(needs.init.outputs.tests)}}
steps:
# run the e2e tests using composite common/workflows/e2e action
- name: "E2E"
id: e2e
continue-on-error: true
uses: cloudoperators/common/workflows/e2e@main
env:
RUNTIME_ENV: "CI"
GH_APP_ID: ${{ secrets.CLOUDOPERATOR_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.CLOUDOPERATOR_APP_PRIVATE_KEY }}
GH_APP_INSTALLATION_ID: ${{ secrets.CLOUDOPERATOR_APP_INSTALLATION_ID }}
with:
admin-k8s-version: "v1.33.7"
remote-k8s-version: ${{ matrix.k8s-version }}
scenario: ${{ matrix.e2es }}
admin-config: ${{ github.workspace }}/e2e/greenhouse-admin-cluster.yaml
remote-config: ${{ github.workspace }}/dev-env/greenhouse-remote-cluster.yaml
- name: "Display Logs"
if: ${{ steps.e2e.outcome == 'failure' }}
env:
SCENARIO: ${{ matrix.e2es }}
run: |
make show-e2e-logs
- name: "E2E Failure?"
if: ${{ steps.e2e.outcome == 'failure' }}
run: |
exit 1
# check if the e2e tests passed for all scenarios
checksOK:
name: "E2E Check"
needs: [ e2e ]
runs-on: [ ubuntu-latest ]
if: always()
steps:
- name: "Check if e2e passed"
run: |
if [ "${{ needs.e2e.result }}" == "success" ]; then
echo "✅ E2E passed 🎉"
else
echo "❌ E2E failed 😭"
exit 1
fi