-
Notifications
You must be signed in to change notification settings - Fork 56
103 lines (83 loc) · 2.95 KB
/
e2e.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
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0
---
# yamllint disable rule:line-length
name: E2E
on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize, reopened]
env:
NAME_PREFIX: "rdr-"
# Limit number of drenv workers.
MAX_WORKERS: 4
GATHER_DIR: gather.${{ github.run_id }}-${{ github.run_attempt }}
jobs:
e2e-rdr:
runs-on: [self-hosted, e2e-rdr]
if: github.repository == 'RamenDR/ramen' && github.event.pull_request.author_association == 'MEMBER'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install drenv
run: pip install -e test
- name: Setup drenv
working-directory: test
run: drenv setup -v envs/regional-dr.yaml
- name: Install ramenctl
run: pip install -e ramenctl
- name: Delete clusters
if: always()
working-directory: test
run: drenv delete --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
- name: Setup libvirt
run: test/scripts/setup-libvirt
- name: Start clusters
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
max_attempts: 3
command: |
cd test
drenv start --max-workers ${{ env.MAX_WORKERS }} --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
- name: Build ramen-operator container
run: make docker-build
- name: Deploy ramen
run: ramenctl deploy --name-prefix ${{ env.NAME_PREFIX }} test/envs/regional-dr.yaml
- name: Configure ramen
uses: nick-fields/retry@v3
with:
timeout_seconds: 120
max_attempts: 3
command: ramenctl config --name-prefix ${{ env.NAME_PREFIX }} test/envs/regional-dr.yaml
- name: Run e2e tests
run: |
cat ~/.config/drenv/${{ env.NAME_PREFIX }}rdr/config.yaml >> e2e/config.yaml
make e2e-rdr
- name: Gather environment data
if: failure()
working-directory: test
run: drenv gather --directory ${{ env.GATHER_DIR }} --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
# Tar manually to work around github limitations with special chracters (:)
# in file names, and getting much smaller archives comapred with zip (6m vs
# 12m).
# https://github.com/actions/upload-artifact/issues/546
- name: Archive gathered data
if: failure()
working-directory: test
run: tar czf ${{ env.GATHER_DIR }}.tar.gz ${{ env.GATHER_DIR }}
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ env.GATHER_DIR }}
path: test/${{ env.GATHER_DIR }}.tar.gz
compression-level: 0
retention-days: 15
- name: Delete clusters
if: always()
working-directory: test
run: drenv delete --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
- name: Cleanup drenv
if: always()
working-directory: test
run: drenv cleanup -v envs/regional-dr.yaml