@@ -62,47 +62,75 @@ jobs:
62
62
path : rel-notes.md
63
63
64
64
build_release :
65
- needs : release_notes
66
65
name : Build Release
66
+ needs : release_notes
67
67
strategy :
68
68
matrix :
69
69
platform :
70
70
- name : virtual
71
- image : default
72
- nodes : [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
71
+ os : ubuntu
72
+ image : ghcr.io/microsoft/ccf/ci/default:build-14-01-2025
73
+ test_filter : " benchmark|unit"
74
+ - name : snp
75
+ os : ubuntu
76
+ image : ghcr.io/microsoft/ccf/ci/default:build-14-01-2025
77
+ - name : virtual
78
+ os : azure-linux
79
+ image : mcr.microsoft.com/azurelinux/base/core:3.0
80
+ test_filter : " benchmark|unit|protocolstest|lts"
73
81
- name : snp
74
- image : default
75
- nodes : [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
76
- runs-on : ${{ matrix.platform.nodes }}
82
+ os : azure-linux
83
+ image : mcr.microsoft.com/azurelinux/base/core:3.0
84
+
85
+ runs-on : [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
77
86
container :
78
- image : ghcr.io/microsoft/ccf/ci/${{ matrix.platform.image }}:build-14-01-2025
79
- options : " --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro ${{ matrix.platform.container_options }}"
87
+ image : ${{ matrix.platform.image }}
88
+ options : " --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE"
89
+
80
90
steps :
91
+ - name : " Checkout dependencies"
92
+ if : ${{ matrix.platform.os == 'azure-linux' }}
93
+ shell : bash
94
+ run : |
95
+ gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
96
+ tdnf -y update
97
+ tdnf -y install ca-certificates git
98
+
81
99
- uses : actions/checkout@v4
82
100
with :
83
101
fetch-depth : 0
84
102
103
+ - name : " Install dependencies"
104
+ if : ${{ matrix.platform.os == 'azure-linux' }}
105
+ shell : bash
106
+ run : |
107
+ set -ex
108
+ ./scripts/install-azure-linux-deps.sh
109
+ # For packaging and release tests
110
+ tdnf -y install rpm-build
111
+
85
112
- name : " Build Release ${{ matrix.platform.name }}"
113
+ shell : bash
86
114
run : |
87
115
set -ex
88
116
git config --global --add safe.directory /__w/CCF/CCF
89
117
mkdir build
90
118
cd build
91
- cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} ${{ matrix.platform.cmake_options }} -DCLIENT_PROTOCOLS_TEST=ON ..
119
+ CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} -DCLIENT_PROTOCOLS_TEST=ON -DCMAKE_BUILD_TYPE=Release ..
92
120
ninja -v | tee build.log
93
- shell : bash
94
121
95
122
- name : " Install Extended Testing Tools"
123
+ if : ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}
96
124
run : |
97
125
set -ex
98
126
sudo apt-get -y update
99
127
sudo apt install ansible -y
100
128
cd getting_started/setup_vm
101
129
ansible-playbook ccf-extended-testing.yml
102
130
shell : bash
103
- if : ${{ matrix.platform.name != 'snp' }}
104
131
105
132
- name : " Test ${{ matrix.platform.name }}"
133
+ if : " ${{ matrix.platform.name == 'virtual' }}"
106
134
run : |
107
135
set -ex
108
136
cd build
@@ -114,23 +142,23 @@ jobs:
114
142
# Suite tests
115
143
./tests.sh --timeout 600 --output-on-failure -L "suite"
116
144
# Most tests
117
- ./tests.sh --timeout 360 --output-on-failure -LE "benchmark|unit| suite"
145
+ ./tests.sh --timeout 360 --output-on-failure -LE "suite|${{ matrix.platform.test_filter }} "
118
146
shell : bash
119
- if : " ${{ matrix.platform.name != 'snp' }}"
120
147
121
- - name : " Upload logs for ${{ matrix.platform.name }}"
148
+ - name : " Upload logs for ${{ matrix.platform.os }}-${{ matrix.platform.name }}"
149
+ if : success() || failure()
122
150
uses : actions/upload-artifact@v4
123
151
with :
124
- name : logs-${{ matrix.platform.name }}
152
+ name : logs-${{ matrix.platform.os }}-${{ matrix.platform. name }}
125
153
path : |
126
154
build/workspace/*/*.config.json
127
155
build/workspace/*/out
128
156
build/workspace/*/err
129
157
build/workspace/*.ledger/*
130
158
if-no-files-found : ignore
131
- if : success() || failure()
132
159
133
160
- name : " Make .deb Package"
161
+ if : " ${{ matrix.platform.os == 'ubuntu' }}"
134
162
id : make_deb
135
163
run : |
136
164
set -ex
@@ -146,30 +174,56 @@ jobs:
146
174
echo "name=$CCF_GITHUB_PKG" >> $GITHUB_OUTPUT
147
175
shell : bash
148
176
177
+ - name : " Make .rpm Package"
178
+ if : " ${{ matrix.platform.os == 'azure-linux' }}"
179
+ id : make_rpm
180
+ run : |
181
+ set -ex
182
+ set -o pipefail
183
+ cd build
184
+ cmake -L .. 2>/dev/null | grep CMAKE_INSTALL_PREFIX: | cut -d = -f 2 > /tmp/install_prefix
185
+ cpack -V -G RPM
186
+ INITIAL_PKG=`ls *.rpm`
187
+ CCF_GITHUB_PKG=${INITIAL_PKG//\~/_}
188
+ if [[ "$INITIAL_PKG" != "$CCF_GITHUB_PKG" ]]; then
189
+ mv $INITIAL_PKG $CCF_GITHUB_PKG
190
+ fi
191
+ echo "name=$CCF_GITHUB_PKG" >> $GITHUB_OUTPUT
192
+ shell : bash
193
+
149
194
- name : " Install CCF Debian package"
195
+ if : " ${{ matrix.platform.os == 'ubuntu' }}"
150
196
run : |
151
197
set -ex
152
198
cd build
153
199
sudo apt -y install ./${{ steps.make_deb.outputs.name }}
154
200
shell : bash
155
201
202
+ - name : " Install CCF RPM package"
203
+ if : " ${{ matrix.platform.os == 'azure-linux' }}"
204
+ run : |
205
+ set -ex
206
+ cd build
207
+ tdnf -y install ./${{ steps.make_rpm.outputs.name }}
208
+ shell : bash
209
+
156
210
- name : " Test Installed CCF"
211
+ if : " ${{ matrix.platform.name == 'virtual' }}"
157
212
run : |
158
213
set -ex
159
214
set -o pipefail
160
215
cd build
161
216
cat /tmp/install_prefix | xargs -i bash -c "PYTHON_PACKAGE_PATH=../python ./test_install.sh {}"
162
217
shell : bash
163
- if : " ${{ matrix.platform.name != 'snp' }}"
164
218
165
219
- name : " Recovery Benchmark for Installed CCF"
220
+ if : " ${{ matrix.platform.name == 'virtual' }}"
166
221
run : |
167
222
set -ex
168
223
set -o pipefail
169
224
cd build
170
225
cat /tmp/install_prefix | xargs -i bash -c "PYTHON_PACKAGE_PATH=../python ./recovery_benchmark.sh {}"
171
226
shell : bash
172
- if : " ${{ matrix.platform.name != 'snp' }}"
173
227
174
228
- name : " Test Building a Sample Against Installed CCF"
175
229
run : |
@@ -178,26 +232,35 @@ jobs:
178
232
shell : bash
179
233
180
234
- name : " Upload .deb Package"
235
+ if : " ${{ matrix.platform.os == 'ubuntu' }}"
181
236
uses : actions/upload-artifact@v4
182
237
with :
183
- name : pkg-${{ matrix.platform.name }}
238
+ name : pkg-${{ matrix.platform.os }}-${{ matrix.platform. name }}
184
239
path : build/${{ steps.make_deb.outputs.name }}
185
240
241
+ - name : " Upload .rpm Package"
242
+ if : " ${{ matrix.platform.os == 'azure-linux' }}"
243
+ uses : actions/upload-artifact@v4
244
+ with :
245
+ name : pkg-${{ matrix.platform.os }}-${{ matrix.platform.name }}
246
+ path : build/${{ steps.make_rpm.outputs.name }}
247
+
186
248
- name : " Upload Compatibility Report"
249
+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
187
250
uses : actions/upload-artifact@v4
188
251
with :
189
252
name : compatibility
190
253
path : build/compatibility_report.json
191
- if : " ${{ matrix.platform.name == 'virtual' }}"
192
254
193
255
- name : " Upload TLS Report"
256
+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
194
257
uses : actions/upload-artifact@v4
195
258
with :
196
259
name : tls
197
260
path : build/tls_report.html
198
- if : " ${{ matrix.platform.name == 'virtual' }}"
199
261
200
262
- name : " Build Python Wheel"
263
+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
201
264
id : build_wheel
202
265
run : |
203
266
set -ex
@@ -209,16 +272,16 @@ jobs:
209
272
WHL=`ls dist/*.whl`
210
273
echo "name=$WHL" >> $GITHUB_OUTPUT
211
274
shell : bash
212
- if : " ${{ matrix.platform.name == 'virtual' }}"
213
275
214
276
- name : " Upload Python Wheel"
277
+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
215
278
uses : actions/upload-artifact@v4
216
279
with :
217
280
name : wheel
218
281
path : python/${{ steps.build_wheel.outputs.name }}
219
- if : " ${{ matrix.platform.name == 'virtual' }}"
220
282
221
283
- name : " Build TS Package"
284
+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
222
285
id : build_tstgz
223
286
run : |
224
287
set -ex
@@ -231,14 +294,13 @@ jobs:
231
294
PKG=`ls *.tgz`
232
295
echo "name=$PKG" >> $GITHUB_OUTPUT
233
296
shell : bash
234
- if : " ${{ matrix.platform.name == 'virtual' }}"
235
297
236
298
- name : " Upload TS Package"
299
+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
237
300
uses : actions/upload-artifact@v4
238
301
with :
239
302
name : tstgz
240
303
path : js/ccf-app/${{ steps.build_tstgz.outputs.name }}
241
- if : " ${{ matrix.platform.name == 'virtual' }}"
242
304
243
305
create_release :
244
306
needs :
0 commit comments