@@ -28,292 +28,19 @@ concurrency:
2828 cancel-in-progress : true
2929
3030jobs :
31-
32- formatting-check :
33- name : Formatting Check
34- runs-on : ubuntu-latest
35- steps :
36- - uses : actions/checkout@v3
37- - name : Run clang-format style check for C/C++/Protobuf programs.
38- 39- with :
40- clang-format-version : ' 11'
41- exclude-regex : ' .*\.(proto|hpp)'
42-
43- wireshark-dissector-build :
44- name : Build the Wireshark dissector
45- needs : formatting-check
46- runs-on : ${{ matrix.os }}
47- timeout-minutes : 60
48- strategy :
49- matrix :
50- # TODO: support build on macos-14
51- os : [ubuntu-latest]
52-
53- steps :
54- - name : checkout
55- uses : actions/checkout@v3
56-
57- - name : Install deps (Ubuntu)
58- if : ${{ startsWith(matrix.os, 'ubuntu') }}
59- run : |
60- sudo apt-get update -y
61- sudo apt-get install -y protobuf-compiler libprotobuf-dev wireshark-dev
62-
63- - name : Install deps (macOS)
64- if : ${{ startsWith(matrix.os, 'macos') }}
65- run : |
66- # See https://github.com/Homebrew/homebrew-core/issues/157142
67- export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
68- cd /usr/local/bin
69- rm -f 2to3* idle3* pydoc* python3*
70- rm -f /usr/local/share/man/man1/python3.1 /usr/local/lib/pkgconfig/python3*
71- cd /usr/local/Frameworks/Python.framework
72- rm -rf Headers Python Resources Versions/Current
73- brew update
74- brew install pkg-config wireshark protobuf
75- - name : Build wireshark plugin
76- run : |
77- cmake -S wireshark -B build-wireshark
78- cmake --build build-wireshark
79-
80- lint :
81- name : Lint
82- needs : formatting-check
83- runs-on : ubuntu-24.04
84- timeout-minutes : 120
85-
86- steps :
87- - name : checkout
88- uses : actions/checkout@v3
89- with :
90- fetch-depth : 0
91- submodules : recursive
92-
93- - name : Build the project
94- run : |
95- cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
96- cmake --build build -j8
97-
98- - name : Tidy check
99- run : |
100- sudo apt-get install -y clang-tidy
101- ./build-support/run_clang_tidy.sh
102- if [[ $? -ne 0 ]]; then
103- echo "clang-tidy failed"
104- exit 1
105- fi
106-
107- unit-tests :
108- name : Run unit tests
109- needs : formatting-check
110- runs-on : ubuntu-24.04
111- timeout-minutes : 120
112-
113- steps :
114- - name : checkout
115- uses : actions/checkout@v3
116- with :
117- fetch-depth : 0
118- submodules : recursive
119-
120- - name : Build core libraries
121- run : |
122- cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=OFF
123- cmake --build build -j8
124-
125- - name : Check formatting
126- run : |
127- ./vcpkg/vcpkg format-manifest vcpkg.json
128- if [[ $(git diff | wc -l) -gt 0 ]]; then
129- echo "Please run `./vcpkg/vcpkg format-manifest vcpkg.json` to reformat vcpkg.json"
130- exit 1
131- fi
132-
133- - name : Build tests
134- run : |
135- cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
136- cmake --build build -j8
137-
138- - name : Install gtest-parallel
139- run : |
140- sudo curl -o /gtest-parallel https://raw.githubusercontent.com/google/gtest-parallel/master/gtest_parallel.py
141-
142- - name : Run unit tests
143- run : RETRY_FAILED=3 CMAKE_BUILD_DIRECTORY=./build ./run-unit-tests.sh
144-
145- - name : Build with Boost.Asio
146- run : |
147- cmake -B build-boost-asio -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON
148- cmake --build build-boost-asio -j8
149-
150- - name : Build perf tools
151- run : |
152- cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DBUILD_PERF_TOOLS=ON
153- cmake --build build -j8
154-
155- - name : Verify custom vcpkg installation
156- run : |
157- mv vcpkg /tmp/
158- cmake -B build-2 -DINTEGRATE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE="/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake"
159-
160- cpp20-build :
161- name : Build with the C++20 standard
162- needs : lint
163- runs-on : ubuntu-22.04
164- timeout-minutes : 60
165-
166- steps :
167- - name : checkout
168- uses : actions/checkout@v3
169- - name : Install deps
170- run : |
171- sudo apt-get update -y
172- sudo apt-get install -y libcurl4-openssl-dev libssl-dev \
173- protobuf-compiler libprotobuf-dev libboost-dev \
174- libboost-dev libboost-program-options-dev \
175- libzstd-dev libsnappy-dev libgmock-dev libgtest-dev
176- - name : CMake
177- run : cmake -B build -DBUILD_PERF_TOOLS=ON -DCMAKE_CXX_STANDARD=20
178- - name : Build
179- run : |
180- cmake --build build -j8 --target pulsarShared pulsarStatic
181- cmake --build build -j8
182-
183- cpp-build-windows :
184- timeout-minutes : 120
185- name : Build CPP Client on ${{ matrix.name }}
186- needs : unit-tests
187- runs-on : ${{ matrix.os }}
188- env :
189- VCPKG_ROOT : ' ${{ github.workspace }}/vcpkg'
190- INSTALL_DIR : ' C:\\pulsar-cpp'
191- strategy :
192- fail-fast : false
193- matrix :
194- include :
195- - name : ' Windows x64'
196- os : windows-2022
197- triplet : x64-windows-static
198- suffix : ' windows-win64'
199- generator : ' Visual Studio 17 2022'
200- arch : ' -A x64'
201- - name : ' Windows x86'
202- os : windows-2022
203- triplet : x86-windows-static
204- suffix : ' windows-win32'
205- generator : ' Visual Studio 17 2022'
206- arch : ' -A Win32'
207-
208- steps :
209- - name : checkout
210- uses : actions/checkout@v3
211-
212- - name : Restore vcpkg and its artifacts.
213- uses : actions/cache@v3
214- id : vcpkg-cache
215- with :
216- path : |
217- ${{ env.VCPKG_ROOT }}
218- vcpkg_installed
219- !${{ env.VCPKG_ROOT }}/.git
220- !${{ env.VCPKG_ROOT }}/buildtrees
221- !${{ env.VCPKG_ROOT }}/packages
222- !${{ env.VCPKG_ROOT }}/downloads
223- key : |
224- ${{ runner.os }}-${{ matrix.triplet}}-${{ hashFiles( 'vcpkg.json' ) }}
225-
226- - name : Get vcpkg(windows)
227- if : ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
228- run : |
229- cd ${{ github.workspace }}
230- mkdir build -force
231- git clone https://github.com/Microsoft/vcpkg.git
232- cd vcpkg
233- .\bootstrap-vcpkg.bat
234-
235- - name : remove system vcpkg(windows)
236- if : runner.os == 'Windows'
237- run : rm -rf "$VCPKG_INSTALLATION_ROOT"
238- shell : bash
239-
240- - name : Install vcpkg packages
241- run : |
242- ${{ env.VCPKG_ROOT }}\vcpkg.exe install --triplet ${{ matrix.triplet }}
243-
244- - name : Configure
245- shell : bash
246- run : |
247- if [ "$RUNNER_OS" == "Windows" ]; then
248- cmake \
249- -B ./build-1 \
250- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
251- -DUSE_ASIO=ON \
252- -DBUILD_TESTS=OFF \
253- -DVCPKG_TRIPLET="${{ matrix.triplet }}" \
254- -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}" \
255- -S .
256- fi
257-
258- - name : Install
259- shell : bash
260- run : |
261- if [ "$RUNNER_OS" == "Windows" ]; then
262- cmake --build ./build-1 --parallel --config Release
263- cmake --install ./build-1
264- fi
265-
266- - name : Test examples
267- shell : bash
268- run : |
269- if [ "$RUNNER_OS" == "Windows" ]; then
270- cd win-examples
271- cmake \
272- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
273- -DLINK_STATIC=OFF \
274- -DCMAKE_PREFIX_PATH=${{ env.INSTALL_DIR }} \
275- -B build-dynamic
276- cmake --build build-dynamic --config Release
277- cmake \
278- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
279- -DLINK_STATIC=ON \
280- -DCMAKE_PREFIX_PATH=${{ env.INSTALL_DIR }} \
281- -B build-static
282- cmake --build build-static --config Release
283- ./build-static/Release/win-example.exe
284- fi
285-
286- - name : Build (Debug)
287- shell : bash
288- run : |
289- if [ "$RUNNER_OS" == "Windows" ]; then
290- cmake \
291- -B ./build-2 \
292- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
293- -DUSE_ASIO=ON \
294- -DBUILD_TESTS=OFF \
295- -DVCPKG_TRIPLET="${{ matrix.triplet }}" \
296- -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}" \
297- -DCMAKE_BUILD_TYPE=Debug \
298- -S .
299- cmake --build ./build-2 --parallel --config Debug
300- fi
301-
302- package :
31+ package-linux :
30332 name : Build ${{matrix.pkg.name}} ${{matrix.cpu.platform}}
30433 runs-on : ubuntu-22.04
305- needs : [lint, unit-tests]
30634 timeout-minutes : 500
30735
30836 strategy :
309- fail-fast : true
37+ fail-fast : false
31038 matrix :
31139 pkg :
312- - { name: 'RPM', type: 'rpm', path: 'pkg/rpm/RPMS' }
313- - { name: 'Deb', type: 'deb', path: 'pkg/deb/BUILD/DEB' }
31440 - { name: 'Alpine', type: 'apk', path: 'pkg/apk/build' }
31541 cpu :
31642 - { arch: 'x86_64', platform: 'x86_64' }
43+ - { arch: 'aarch64', platform: 'arm64' }
31744
31845 steps :
31946 - name : checkout
@@ -341,28 +68,11 @@ jobs:
34168 - name : Build packages
34269 run : pkg/${{matrix.pkg.type}}/docker-build-${{matrix.pkg.type}}-${{matrix.cpu.platform}}.sh build:latest
34370
344- # TODO: verify the pre-built package works without linking issue
71+ - name : Zip artifact
72+ run : zip -r ${{matrix.pkg.type}}-${{matrix.cpu.platform}}.zip ${{matrix.pkg.path}}
34573
346- cpp-build-macos :
347- timeout-minutes : 120
348- name : Build CPP Client on macOS with static dependencies
349- runs-on : macos-14
350- needs : lint
351- steps :
352- - name : checkout
353- uses : actions/checkout@v3
74+ - name : Upload artifacts
75+ uses : actions/upload-artifact@master
35476 with :
355- fetch-depth : 0
356- submodules : recursive
357-
358- - name : Build libraries
359- run : ./pkg/mac/build-static-library.sh
360-
361- # Job that will be required to complete and depends on all the other jobs
362- check-completion :
363- name : Check Completion
364- runs-on : ubuntu-latest
365- needs : [formatting-check, wireshark-dissector-build, lint, unit-tests, cpp20-build, cpp-build-windows, package, cpp-build-macos]
366-
367- steps :
368- - run : true
77+ name : ${{matrix.pkg.type}}-${{matrix.cpu.platform}}
78+ path : ${{matrix.pkg.path}}
0 commit comments