-
Notifications
You must be signed in to change notification settings - Fork 24
176 lines (162 loc) · 5.61 KB
/
cpaas.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: CPaaS related workflows
on:
schedule:
- cron: '0 6 * * *'
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- reopened
concurrency:
group: cpaas-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
should-run:
outputs:
should-run: ${{ steps.should-run.outputs.should-run }}
runs-on: ubuntu-latest
steps:
- id: should-run
run: |
SHOULD_RUN="${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'run-cpaas-steps') }}"
echo "should-run=${SHOULD_RUN}" >> "$GITHUB_OUTPUT"
init:
needs:
- should-run
if: needs.should-run.outputs.should-run == 'true'
uses: ./.github/workflows/init.yml
with:
cpaas-workflow: true
sync-drivers-and-support-packages:
uses: ./.github/workflows/cpaas-sync-drivers.yml
needs: init
secrets: inherit
with:
support-packages-bucket: ${{ needs.init.outputs.cpaas-support-packages-bucket }}
support-packages-index-bucket: ${{ needs.init.outputs.support-packages-index-bucket }}
public-support-packages-bucket: ${{ needs.init.outputs.public-support-packages-bucket }}
drivers-bucket: ${{ needs.init.outputs.cpaas-drivers-bucket }}
merged-drivers-bucket: ${{ needs.init.outputs.merged-drivers-bucket }}
all-archs-drivers-bucket: ${{ needs.init.outputs.cpaas-all-archs-drivers-bucket }}
branch-name: ${{ needs.init.outputs.branch-name }}
check-drivers-failures:
uses: ./.github/workflows/check-drivers-failures.yml
needs: sync-drivers-and-support-packages
with:
logs-artifact:
drivers-build-failures
build-collector-slim:
runs-on: ubuntu-latest
needs: init
strategy:
matrix:
arch:
- amd64
- s390x
- ppc64le
steps:
- uses: docker/login-action@v3
with:
registry: brew.registry.redhat.io
username: ${{ secrets.REDHAT_USERNAME }}
password: ${{ secrets.REDHAT_PASSWORD }}
- name: Pull downstream slim collector
run: |
docker pull --platform linux/${{ matrix.arch }} brew.registry.redhat.io/rh-osbs/rhacs-collector-slim-rhel8:0.1.0
- name: Retag and push stackrox-io -amd64-slim
uses: stackrox/actions/images/retag-and-push@v1
with:
src-image: brew.registry.redhat.io/rh-osbs/rhacs-collector-slim-rhel8:0.1.0
dst-image: ${{ needs.init.outputs.collector-image }}-cpaas-${{ matrix.arch }}-slim
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}
build-collector-full:
uses: ./.github/workflows/collector-full.yml
with:
collector-tag: ${{ needs.init.outputs.collector-tag }}-cpaas
arch-drivers-bucket: ${{ needs.init.outputs.cpaas-drivers-bucket }}
skip-built-drivers: true
archs: amd64 ppc64le s390x
secrets: inherit
needs:
- init
- build-collector-slim
- sync-drivers-and-support-packages
build-test-containers:
uses: ./.github/workflows/integration-test-containers.yml
needs:
- init
with:
collector-tag: ${{ needs.init.outputs.collector-tag }}-cpaas
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
rebuild-qa-containers: ${{ needs.init.outputs.rebuild-qa-containers == 'true' }}
secrets: inherit
integration-tests:
uses: ./.github/workflows/integration-tests-vm-type.yml
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }}
strategy:
# ensure that if one part of the matrix fails, the
# rest will continue
fail-fast: false
matrix:
vm_type:
- rhel
- rhel-sap
- rhel-s390x
with:
vm_type: ${{ matrix.vm_type }}
collector-tag: ${{ needs.init.outputs.collector-tag }}-cpaas
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
offline-mode: true
job-tag: cpaas
needs:
- init
- build-collector-full
- build-test-containers
secrets: inherit
# Isolating multi-arch testing temporarily while fixes are found for ppc64le
multiarch-integration-tests:
uses: ./.github/workflows/integration-tests-vm-type.yml
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') &&
contains(github.event.pull_request.labels.*.name, 'run-multiarch-tests') }}
strategy:
# ensure that if one part of the matrix fails, the
# rest will continue
fail-fast: false
matrix:
vm_type:
- rhel-ppc64le
with:
vm_type: ${{ matrix.vm_type }}
collector-tag: ${{ needs.init.outputs.collector-tag }}-cpaas
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
offline-mode: true
job-tag: cpaas
needs:
- init
- build-collector-full
secrets: inherit
notify:
runs-on: ubuntu-latest
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name == 'schedule'
needs:
- init
- sync-drivers-and-support-packages
- build-collector-slim
- build-collector-full
- integration-tests
- multiarch-integration-tests
steps:
- name: Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
SLACK_CHANNEL: team-acs-collector-oncall
SLACK_COLOR: failure
SLACK_LINK_NAMES: true
SLACK_TITLE: Downstream nightly failed
MSG_MINIMAL: actions url,commit
SLACK_MESSAGE: |
@acs-collector-oncall