forked from cloud-bulldozer/benchmark-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.82 KB
/
e2e.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
name: Run e2e tests
on:
pull_request_target:
types: [labeled, synchronize]
push:
branches:
- master
workflow_dispatch:
inputs:
test_list:
description: Only run tests that match the regular expression
default: ""
img:
description: Benchmark-operator image location
default: quay.io/rht_perf_ci/benchmark-operator:e2e
concurrency:
group: e2e-ci
jobs:
e2e:
name: E2E testing
runs-on: ubuntu-latest
timeout-minutes: 120
if: "github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ok to test'))"
env:
BATS_TESTS: ${{ github.event.inputs.test_list }}
IMG: ${{ github.event.inputs.img }}
steps:
- name: Set env vars # Workaround: When the workflow is triggered by events different from workflow_dispatch the IMG env var is not set
run: echo "IMG=quay.io/rht_perf_ci/benchmark-operator:e2e" >> $GITHUB_ENV
if: github.event_name != 'workflow_dispatch'
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request_target'
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
if: "github.event_name == 'workflow_dispatch' || github.event_name == 'push'"
- name: Install bats
run: make install-bats
- name: Authenticate against OCP cluster
run: oc login -u ${OPENSHIFT_USER} -p ${OPENSHIFT_PASSWORD} ${OPENSHIFT_SERVER} --insecure-skip-tls-verify=true
env:
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
OPENSHIFT_USER: ${{ secrets.OPENSHIFT_USER }}
OPENSHIFT_PASSWORD: ${{ secrets.OPENSHIFT_PASSWORD }}
- name: Login in quay
run: podman login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
env:
QUAY_USER: ${{ secrets.QUAY_CI_USER }}
QUAY_TOKEN: ${{ secrets.QUAY_CI_TOKEN }}
- name: Build, push and deploy benchmark-operator
run: make image-build image-push deploy
- name: Ensure benchmark-operator is running
run: kubectl rollout status -n benchmark-operator --timeout=5m deploy/benchmark-controller-manager
- name: Execute e2e tests
run: e2e/run_tests_ci.sh
env:
TERM: linux
- name: Undeploy benchmark-operator
run: make undeploy
if: always() # always run even if the previous step fails
- name: Upload artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: benchmark-operator-debug-${{ github.run_id }}
path: e2e/artifacts
- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
report_paths: e2e/report.xml