-
Notifications
You must be signed in to change notification settings - Fork 45
253 lines (241 loc) · 8.63 KB
/
nightly.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
name: Nightly
run-name: "Nightly tests for ${{ github.ref_name }}"
on:
workflow_dispatch:
inputs:
artifacts-url:
description: Artifacts URL to use (fallback to the latest post-merge build on this branch)
type: string
required: false
enable-debug-when-failure:
description: "Whether or not debug when failure should be enabled or not"
required: false
type: boolean
default: false
jobs:
retrieve-info:
runs-on: ubuntu-22.04
outputs:
artifacts-link: ${{ inputs.artifacts-url || steps.artifacts.outputs.link }}
version_major: ${{ steps.get-version.outputs.version_major }}
version_minor: ${{ steps.get-version.outputs.version_minor }}
version_patch: ${{ steps.get-version.outputs.version_patch }}
version_suffix: ${{ steps.get-version.outputs.version_suffix }}
version_full: ${{ steps.get-version.outputs.version_full }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Retrieve artifacts url
uses: scality/action-artifacts@v4
id: artifacts
if: inputs.artifacts-url == ''
with:
method: get
workflow-name: Post-merge
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
- name: Retrieve current version
id: get-version
run: |
source VERSION
echo "version_major=$VERSION_MAJOR" >> $GITHUB_OUTPUT
echo "version_minor=$VERSION_MINOR" >> $GITHUB_OUTPUT
echo "version_patch=$VERSION_PATCH" >> $GITHUB_OUTPUT
echo "version_suffix=$VERSION_SUFFIX" >> $GITHUB_OUTPUT
echo "version_full=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH-$VERSION_SUFFIX" >> $GITHUB_OUTPUT
compute-lifecycle-promoted-matrix:
runs-on: ubuntu-22.04
needs:
- retrieve-info
env:
VERSION_MAJOR: ${{ needs.retrieve-info.outputs.version_major }}
VERSION_MINOR: ${{ needs.retrieve-info.outputs.version_minor }}
VERSION_PATCH: ${{ needs.retrieve-info.outputs.version_patch }}
outputs:
# Every element of the matrix will have
# - `type` which is the type of lifecycle (major, minor, patch)
# - `version` the promoted version
lifecycle-matrix: ${{ steps.get-matrix.outputs.matrix }}
artifacts-link: ${{ needs.retrieve-info.outputs.artifacts-link }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch tags
run: git fetch --tags
- name: Get previous patch version
run: |
if [ "$VERSION_PATCH" != "0" ]; then
echo "previous_patch=$VERSION_MAJOR.$VERSION_MINOR.$(( VERSION_PATCH - 1))" >> $GITHUB_ENV
else
echo "previous_patch=" >> $GITHUB_ENV
fi
- name: Get previous minor version
run: |
echo "previous_minor=$(git tag --sort=taggerdate --list "$VERSION_MAJOR.$(( VERSION_MINOR - 1 )).*" | grep -v '\-' | tail -1)" >> $GITHUB_ENV
- name: Get previous major version
run: |
echo "previous_major=$(git tag --sort=taggerdate --list "$((VERSION_MAJOR - 1 )).*" | grep -v '\-' | tail -1)" >> $GITHUB_ENV
- name: Compute matrix
id: get-matrix
run: |
matrix="["
for type in patch minor major; do
var_name="previous_${type}"
if [ -n "${!var_name}" ]; then
if [ "${#matrix}" -gt "1" ]; then
matrix+=","
fi
matrix+="{\"type\": \"$type\", \"version\": \"${!var_name}\"}"
fi
done
matrix+="]"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
compute-lifecycle-dev-matrix:
runs-on: ubuntu-22.04
needs:
- retrieve-info
env:
VERSION_MAJOR: ${{ needs.retrieve-info.outputs.version_major }}
VERSION_MINOR: ${{ needs.retrieve-info.outputs.version_minor }}
outputs:
# Every element of the matrix will have
# - `type` which is the type of lifecycle (major, minor)
# - `branch` the dev branch name
lifecycle-matrix: ${{ steps.get-matrix.outputs.matrix }}
artifacts-link: ${{ needs.retrieve-info.outputs.artifacts-link }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get previous minor version
run: |
if [ "$VERSION_MINOR" != "0" ]; then
echo "previous_minor=development/$VERSION_MAJOR.$(( VERSION_MINOR - 1))" >> $GITHUB_ENV
else
echo "previous_minor=" >> $GITHUB_ENV
fi
- name: Get previous major version
run: |
echo "previous_major=$(git branch --remote --sort=creatordate --list --format="%(refname:lstrip=-2)" "origin/development/$(( VERSION_MAJOR - 1 )).*" | tail -1)" >> $GITHUB_ENV
- name: Compute matrix
id: get-matrix
run: |
matrix="["
for type in minor major; do
var_name="previous_${type}"
if [ -n "${!var_name}" ]; then
if [ "${#matrix}" -gt "1" ]; then
matrix+=","
fi
matrix+="{\"type\": \"$type\", \"branch\": \"${!var_name}\"}"
fi
done
matrix+="]"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
lifecycle-promoted:
uses: ./.github/workflows/lifecycle-promoted.yaml
secrets: inherit
needs:
- compute-lifecycle-promoted-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.compute-lifecycle-promoted-matrix.outputs.lifecycle-matrix) }}
with:
artifacts-url: ${{ needs.compute-lifecycle-promoted-matrix.outputs.artifacts-link }}
type: ${{ matrix.type }}
promoted-version: ${{ matrix.version }}
enable-debug-when-failure: ${{ inputs.enable-debug-when-failure }}
lifecycle-dev:
uses: ./.github/workflows/lifecycle-dev.yaml
secrets: inherit
needs:
- compute-lifecycle-dev-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.compute-lifecycle-dev-matrix.outputs.lifecycle-matrix) }}
with:
artifacts-url: ${{ needs.compute-lifecycle-dev-matrix.outputs.artifacts-link }}
type: ${{ matrix.type }}
dev-branch: ${{ matrix.branch }}
enable-debug-when-failure: ${{ inputs.enable-debug-when-failure }}
install:
uses: ./.github/workflows/single-node-test.yaml
secrets: inherit
needs:
- retrieve-info
strategy:
fail-fast: false
matrix:
os:
- centos-7
- rhel-8
# NOTE: We add rocky-8 here even if it's already tested in pre-merge since
# we also test solution install + upgrade there
- rocky-8
setup-idp: [true]
setup-logging: [true]
include:
- os: rocky-8
setup-idp: false
setup-logging: false
with:
artifacts-url: ${{ needs.retrieve-info.outputs.artifacts-link }}
os: ${{ matrix.os }}
test-solution: true
setup-idp: ${{ matrix.setup-idp }}
setup-logging: ${{ matrix.setup-logging }}
enable-debug-when-failure: ${{ inputs.enable-debug-when-failure }}
bootstrap-restore:
uses: ./.github/workflows/multi-node-test.yaml
secrets: inherit
needs:
- retrieve-info
with:
name: bootstrap-restore
artifacts-url: ${{ needs.retrieve-info.outputs.artifacts-link }}
nodes-count: 2
bootstrap-restore: true
enable-debug-when-failure: ${{ inputs.enable-debug-when-failure }}
k8s-conformance:
uses: ./.github/workflows/multi-node-test.yaml
secrets: inherit
needs:
- retrieve-info
with:
name: k8s-conformance
artifacts-url: ${{ needs.retrieve-info.outputs.artifacts-link }}
nodes-count: 2
k8s-conformance: true
enable-debug-when-failure: ${{ inputs.enable-debug-when-failure }}
generate-sbom:
uses: ./.github/workflows/generate-sbom.yaml
needs:
- retrieve-info
secrets: inherit
with:
ref: ${{ github.ref }}
artifacts-url: ${{ needs.retrieve-info.outputs.artifacts-link }}
write-final-status:
runs-on: ubuntu-22.04
needs:
- lifecycle-promoted
- lifecycle-dev
- install
- bootstrap-restore
- k8s-conformance
- generate-sbom
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Upload final status
if: always()
uses: scality/actions/[email protected]
with:
ARTIFACTS_USER: ${{ secrets.ARTIFACTS_USER }}
ARTIFACTS_PASSWORD: ${{ secrets.ARTIFACTS_PASSWORD }}
JOBS_RESULTS: ${{ join(needs.*.result) }}