-
Notifications
You must be signed in to change notification settings - Fork 31
147 lines (128 loc) · 4.89 KB
/
run-osp-extended-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
147
name: openstack-extended-tests
on:
workflow_dispatch:
name:
description: 'run e2e openstack extended tests on a self hosted runner'
workflow_call:
issue_comment:
types: [ created ]
# ensures that only a single workflow will run at the same time
# if another workflow triggered it will be pending until first completion.
concurrency:
group: hosted-e2e
# A workflow run is made up of one or more jobs that can run sequentially
jobs:
create_ovirt_runner:
if: github.event_name == 'workflow_dispatch' ||
( github.event_name == 'issue_comment' &&
startsWith(github.event.comment.body, '/test-osp-extended') && (
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')
)
runs-on: ubuntu-latest
steps:
- name: Get PR branch
uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
if: github.event_name == 'issue_comment'
- name: Set latest commit status as pending
if: github.event_name == 'issue_comment'
uses: myrotvorets/set-commit-status-action@master
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
- name: Checkout forklift
uses: actions/checkout@v4
- name: prepare the secrets
uses: kubev2v/forkliftci/ci/[email protected]
with:
OKD_ENGINE_SECRETS: ${{ secrets.OKD_ENGINE_SECRETS }}
OKD_SSH_KEY: ${{ secrets.OKD_SSH_KEY }}
- name: provision self hosted runner
uses: kubev2v/forkliftci/ci/[email protected]
- name: Set latest commit status as ${{ job.status }}
uses: myrotvorets/set-commit-status-action@master
if: ${{ failure() || cancelled() }}
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
ci_setup:
runs-on: self-hosted
needs: create_ovirt_runner
env:
USE_BAZEL_VERSION: 5.4.0
source_provider: openstack
timeout-minutes: 45
steps:
- name: Checkout forklift
uses: actions/checkout@v4
with:
path: forklift
- name: Checkout forkliftci
uses: actions/checkout@v4
with:
repository: kubev2v/forkliftci
ref: v6.0
- name: build and setup everything
uses: kubev2v/forkliftci/ci/[email protected]
with:
provider_name: openstack
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
enable_openstack_ssl: true
- run: kubectl version
- run: kubectl get pods -n konveyor-forklift
- name: run e2e-sanity-openstack extended
uses: kubev2v/forkliftci/ci/[email protected]
with:
suite_name: e2e-sanity-openstack-extended
- name: run e2e-sanity-openstack migration
uses: kubev2v/forkliftci/ci/[email protected]
with:
suite_name: e2e-sanity-openstack
- name: save k8s logs and upload-artifact
if: ${{ always() }}
uses: kubev2v/forkliftci/ci/[email protected]
with:
source_provider: openstack
- name: Get PR branch
if: always() && github.event_name == 'issue_comment'
uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- name: Set latest commit status as ${{ job.status }}
uses: myrotvorets/set-commit-status-action@master
if: always() && github.event_name == 'issue_comment'
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
- name: Add comment to PR
uses: actions/github-script@v7
if: always() && github.event_name == 'issue_comment'
with:
script: |
const name = '${{ github.workflow }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const success = '${{ job.status }}' === 'success';
const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})
remove_ovirt_runner:
runs-on: ubuntu-latest
if: ${{ success() || failure() || cancelled() }}
needs: [create_ovirt_runner,ci_setup]
steps:
- name: prepare the secrets
uses: kubev2v/forkliftci/ci/[email protected]
with:
OKD_ENGINE_SECRETS: ${{ secrets.OKD_ENGINE_SECRETS }}
OKD_SSH_KEY: ${{ secrets.OKD_SSH_KEY }}
- name: provision self hosted runner
uses: kubev2v/forkliftci/ci/[email protected]
with:
perform_cleanup: true