@@ -62,47 +62,75 @@ jobs:
6262 path : rel-notes.md
6363
6464 build_release :
65- needs : release_notes
6665 name : Build Release
66+ needs : release_notes
6767 strategy :
6868 matrix :
6969 platform :
7070 - 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"
7381 - 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]
7786 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+
8090 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+
8199 - uses : actions/checkout@v4
82100 with :
83101 fetch-depth : 0
84102
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+
85112 - name : " Build Release ${{ matrix.platform.name }}"
113+ shell : bash
86114 run : |
87115 set -ex
88116 git config --global --add safe.directory /__w/CCF/CCF
89117 mkdir build
90118 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 ..
92120 ninja -v | tee build.log
93- shell : bash
94121
95122 - name : " Install Extended Testing Tools"
123+ if : ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}
96124 run : |
97125 set -ex
98126 sudo apt-get -y update
99127 sudo apt install ansible -y
100128 cd getting_started/setup_vm
101129 ansible-playbook ccf-extended-testing.yml
102130 shell : bash
103- if : ${{ matrix.platform.name != 'snp' }}
104131
105132 - name : " Test ${{ matrix.platform.name }}"
133+ if : " ${{ matrix.platform.name == 'virtual' }}"
106134 run : |
107135 set -ex
108136 cd build
@@ -114,23 +142,23 @@ jobs:
114142 # Suite tests
115143 ./tests.sh --timeout 600 --output-on-failure -L "suite"
116144 # 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 }} "
118146 shell : bash
119- if : " ${{ matrix.platform.name != 'snp' }}"
120147
121- - name : " Upload logs for ${{ matrix.platform.name }}"
148+ - name : " Upload logs for ${{ matrix.platform.os }}-${{ matrix.platform.name }}"
149+ if : success() || failure()
122150 uses : actions/upload-artifact@v4
123151 with :
124- name : logs-${{ matrix.platform.name }}
152+ name : logs-${{ matrix.platform.os }}-${{ matrix.platform. name }}
125153 path : |
126154 build/workspace/*/*.config.json
127155 build/workspace/*/out
128156 build/workspace/*/err
129157 build/workspace/*.ledger/*
130158 if-no-files-found : ignore
131- if : success() || failure()
132159
133160 - name : " Make .deb Package"
161+ if : " ${{ matrix.platform.os == 'ubuntu' }}"
134162 id : make_deb
135163 run : |
136164 set -ex
@@ -146,30 +174,56 @@ jobs:
146174 echo "name=$CCF_GITHUB_PKG" >> $GITHUB_OUTPUT
147175 shell : bash
148176
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+
149194 - name : " Install CCF Debian package"
195+ if : " ${{ matrix.platform.os == 'ubuntu' }}"
150196 run : |
151197 set -ex
152198 cd build
153199 sudo apt -y install ./${{ steps.make_deb.outputs.name }}
154200 shell : bash
155201
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+
156210 - name : " Test Installed CCF"
211+ if : " ${{ matrix.platform.name == 'virtual' }}"
157212 run : |
158213 set -ex
159214 set -o pipefail
160215 cd build
161216 cat /tmp/install_prefix | xargs -i bash -c "PYTHON_PACKAGE_PATH=../python ./test_install.sh {}"
162217 shell : bash
163- if : " ${{ matrix.platform.name != 'snp' }}"
164218
165219 - name : " Recovery Benchmark for Installed CCF"
220+ if : " ${{ matrix.platform.name == 'virtual' }}"
166221 run : |
167222 set -ex
168223 set -o pipefail
169224 cd build
170225 cat /tmp/install_prefix | xargs -i bash -c "PYTHON_PACKAGE_PATH=../python ./recovery_benchmark.sh {}"
171226 shell : bash
172- if : " ${{ matrix.platform.name != 'snp' }}"
173227
174228 - name : " Test Building a Sample Against Installed CCF"
175229 run : |
@@ -178,26 +232,35 @@ jobs:
178232 shell : bash
179233
180234 - name : " Upload .deb Package"
235+ if : " ${{ matrix.platform.os == 'ubuntu' }}"
181236 uses : actions/upload-artifact@v4
182237 with :
183- name : pkg-${{ matrix.platform.name }}
238+ name : pkg-${{ matrix.platform.os }}-${{ matrix.platform. name }}
184239 path : build/${{ steps.make_deb.outputs.name }}
185240
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+
186248 - name : " Upload Compatibility Report"
249+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
187250 uses : actions/upload-artifact@v4
188251 with :
189252 name : compatibility
190253 path : build/compatibility_report.json
191- if : " ${{ matrix.platform.name == 'virtual' }}"
192254
193255 - name : " Upload TLS Report"
256+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
194257 uses : actions/upload-artifact@v4
195258 with :
196259 name : tls
197260 path : build/tls_report.html
198- if : " ${{ matrix.platform.name == 'virtual' }}"
199261
200262 - name : " Build Python Wheel"
263+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
201264 id : build_wheel
202265 run : |
203266 set -ex
@@ -209,16 +272,16 @@ jobs:
209272 WHL=`ls dist/*.whl`
210273 echo "name=$WHL" >> $GITHUB_OUTPUT
211274 shell : bash
212- if : " ${{ matrix.platform.name == 'virtual' }}"
213275
214276 - name : " Upload Python Wheel"
277+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
215278 uses : actions/upload-artifact@v4
216279 with :
217280 name : wheel
218281 path : python/${{ steps.build_wheel.outputs.name }}
219- if : " ${{ matrix.platform.name == 'virtual' }}"
220282
221283 - name : " Build TS Package"
284+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
222285 id : build_tstgz
223286 run : |
224287 set -ex
@@ -231,14 +294,13 @@ jobs:
231294 PKG=`ls *.tgz`
232295 echo "name=$PKG" >> $GITHUB_OUTPUT
233296 shell : bash
234- if : " ${{ matrix.platform.name == 'virtual' }}"
235297
236298 - name : " Upload TS Package"
299+ if : " ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
237300 uses : actions/upload-artifact@v4
238301 with :
239302 name : tstgz
240303 path : js/ccf-app/${{ steps.build_tstgz.outputs.name }}
241- if : " ${{ matrix.platform.name == 'virtual' }}"
242304
243305 create_release :
244306 needs :
0 commit comments