-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (81 loc) · 3.36 KB
/
Copy pathpr.yml
File metadata and controls
92 lines (81 loc) · 3.36 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
82
83
84
85
86
87
88
89
90
91
92
name: PR
on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
uses: ./.github/workflows/unit-tests.yml
check-olm-label:
runs-on: ubuntu-latest
outputs:
has-label: ${{ steps.check.outputs.has-label }}
steps:
- name: Check for olm-tests label
id: check
run: |
has_label="${{ contains(github.event.pull_request.labels.*.name, 'olm-tests') }}"
echo "has-label=${has_label}" >> "$GITHUB_OUTPUT"
if [ "$has_label" = "true" ]; then
echo "::notice::olm-tests label is set — OpenShift cluster will be created"
else
echo "::notice::olm-tests label is not set — skipping OpenShift cluster"
fi
create-gke-cluster:
if: github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/create-dev-cluster.yml
with:
cluster-name: infra-roxie-pr-${{ github.event.pull_request.number }}-gke
flavor: gke-default
args: machine-type=e2-standard-4,nodes=3,gcp-image-type=ubuntu_containerd
secrets: inherit
create-openshift-cluster:
needs: check-olm-label
if: needs.check-olm-label.outputs.has-label == 'true' && github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/create-dev-cluster.yml
with:
cluster-name: infra-roxie-pr-${{ github.event.pull_request.number }}-openshift
flavor: ocp-4
args: master-node-type=e2-standard-4,worker-node-type=e2-standard-8,master-node-count=3,worker-node-count=3
secrets: inherit
build-roxie-image:
if: github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/build-roxie-image.yml
permissions:
contents: read
packages: write
secrets: inherit
e2e-tests:
if: github.event.pull_request.head.repo.full_name == github.repository
needs: [ create-gke-cluster, build-roxie-image ]
uses: ./.github/workflows/e2e-tests.yml
with:
cluster-name: ${{ needs.create-gke-cluster.outputs.cluster-name }}
image: ${{ needs.build-roxie-image.outputs.image }}
secrets: inherit
e2e-tests-openshift:
if: github.event.pull_request.head.repo.full_name == github.repository
needs: [ create-openshift-cluster, build-roxie-image ]
uses: ./.github/workflows/e2e-tests.yml
with:
cluster-name: ${{ needs.create-openshift-cluster.outputs.cluster-name }}
image: ${{ needs.build-roxie-image.outputs.image }}
cluster-type: openshift
skip-olm-tests: 'false'
secrets: inherit
delete-gke-cluster:
if: ${{ always() && needs.create-gke-cluster.result == 'success' && github.event.pull_request.head.repo.full_name == github.repository }}
needs: [ create-gke-cluster, e2e-tests ]
uses: ./.github/workflows/delete-dev-cluster.yml
with:
cluster-name: ${{ needs.create-gke-cluster.outputs.cluster-name }}
secrets: inherit
delete-openshift-cluster:
if: ${{ always() && needs.create-openshift-cluster.result == 'success' && github.event.pull_request.head.repo.full_name == github.repository }}
needs: [ create-openshift-cluster, e2e-tests-openshift ]
uses: ./.github/workflows/delete-dev-cluster.yml
with:
cluster-name: ${{ needs.create-openshift-cluster.outputs.cluster-name }}
secrets: inherit