Skip to content

Commit a95e7e5

Browse files
committed
Add CMake jobs to GHA
1 parent 8b79199 commit a95e7e5

File tree

1 file changed

+335
-0
lines changed

1 file changed

+335
-0
lines changed

.github/workflows/ci.yml

+335
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,338 @@ jobs:
165165
with:
166166
github-token: ${{ secrets.github_token }}
167167
parallel-finished: true
168+
169+
posix-cmake-subdir:
170+
strategy:
171+
fail-fast: false
172+
matrix:
173+
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
174+
shared: [ OFF, ON ]
175+
176+
runs-on: ${{matrix.os}}
177+
178+
steps:
179+
- uses: actions/checkout@v4
180+
181+
- name: Install packages
182+
if: matrix.install
183+
run: sudo apt-get -y install ${{matrix.install}}
184+
185+
- name: Setup Boost
186+
run: |
187+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
188+
LIBRARY=${GITHUB_REPOSITORY#*/}
189+
echo LIBRARY: $LIBRARY
190+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
191+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
192+
echo GITHUB_REF: $GITHUB_REF
193+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
194+
REF=${REF#refs/heads/}
195+
echo REF: $REF
196+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
197+
echo BOOST_BRANCH: $BOOST_BRANCH
198+
cd ..
199+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
200+
cd boost-root
201+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
202+
git submodule update --init tools/boostdep
203+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
204+
205+
- name: Use library with add_subdirectory
206+
run: |
207+
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
208+
mkdir __build__ && cd __build__
209+
cmake -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
210+
cmake --build .
211+
ctest --output-on-failure --no-tests=error
212+
213+
posix-cmake-install:
214+
strategy:
215+
fail-fast: false
216+
matrix:
217+
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-11 ]
218+
shared: [ OFF, ON ]
219+
220+
runs-on: ${{matrix.os}}
221+
222+
steps:
223+
- uses: actions/checkout@v4
224+
225+
- name: Install packages
226+
if: matrix.install
227+
run: sudo apt-get -y install ${{matrix.install}}
228+
229+
- name: Setup Boost
230+
run: |
231+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
232+
LIBRARY=${GITHUB_REPOSITORY#*/}
233+
echo LIBRARY: $LIBRARY
234+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
235+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
236+
echo GITHUB_REF: $GITHUB_REF
237+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
238+
REF=${REF#refs/heads/}
239+
echo REF: $REF
240+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
241+
echo BOOST_BRANCH: $BOOST_BRANCH
242+
cd ..
243+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
244+
cd boost-root
245+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
246+
git submodule update --init tools/boostdep
247+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
248+
249+
- name: Configure
250+
run: |
251+
cd ../boost-root
252+
mkdir __build__ && cd __build__
253+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
254+
255+
- name: Build
256+
run: |
257+
cd ../boost-root/__build__
258+
cmake --build .
259+
260+
- name: Install
261+
run: |
262+
cd ../boost-root/__build__
263+
cmake --build . --target install
264+
265+
- name: Use the installed library
266+
run: |
267+
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
268+
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
269+
cmake --build .
270+
export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH
271+
ctest --output-on-failure --no-tests=error
272+
273+
posix-cmake-test:
274+
strategy:
275+
fail-fast: false
276+
matrix:
277+
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
278+
shared: [ OFF, ON ]
279+
280+
runs-on: ${{matrix.os}}
281+
282+
steps:
283+
- uses: actions/checkout@v4
284+
285+
- name: Install packages
286+
if: matrix.install
287+
run: sudo apt-get -y install ${{matrix.install}}
288+
289+
- name: Setup Boost
290+
run: |
291+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
292+
LIBRARY=${GITHUB_REPOSITORY#*/}
293+
echo LIBRARY: $LIBRARY
294+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
295+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
296+
echo GITHUB_REF: $GITHUB_REF
297+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
298+
REF=${REF#refs/heads/}
299+
echo REF: $REF
300+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
301+
echo BOOST_BRANCH: $BOOST_BRANCH
302+
cd ..
303+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
304+
cd boost-root
305+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
306+
git submodule update --init tools/boostdep
307+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
308+
309+
- name: Configure
310+
run: |
311+
cd ../boost-root
312+
mkdir __build__ && cd __build__
313+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
314+
315+
- name: Build tests
316+
run: |
317+
cd ../boost-root/__build__
318+
cmake --build . --target tests
319+
320+
- name: Run tests
321+
run: |
322+
cd ../boost-root/__build__
323+
ctest --output-on-failure --no-tests=error
324+
325+
windows-cmake-subdir:
326+
strategy:
327+
fail-fast: false
328+
matrix:
329+
os: [ windows-2019, windows-2022 ]
330+
shared: [ OFF, ON ]
331+
332+
runs-on: ${{matrix.os}}
333+
334+
steps:
335+
- uses: actions/checkout@v4
336+
337+
- name: Setup Boost
338+
shell: cmd
339+
run: |
340+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
341+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
342+
echo LIBRARY: %LIBRARY%
343+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
344+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
345+
echo GITHUB_REF: %GITHUB_REF%
346+
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
347+
set BOOST_BRANCH=develop
348+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
349+
echo BOOST_BRANCH: %BOOST_BRANCH%
350+
cd ..
351+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
352+
cd boost-root
353+
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
354+
git submodule update --init tools/boostdep
355+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
356+
357+
- name: Use library with add_subdirectory (Debug)
358+
shell: cmd
359+
run: |
360+
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
361+
mkdir __build__ && cd __build__
362+
cmake -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
363+
cmake --build . --config Debug
364+
ctest --output-on-failure --no-tests=error -C Debug
365+
366+
- name: Use library with add_subdirectory (Release)
367+
shell: cmd
368+
run: |
369+
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
370+
cmake --build . --config Release
371+
ctest --output-on-failure --no-tests=error -C Release
372+
373+
windows-cmake-install:
374+
strategy:
375+
fail-fast: false
376+
matrix:
377+
os: [ windows-2019, windows-2022 ]
378+
shared: [ OFF, ON ]
379+
380+
runs-on: ${{matrix.os}}
381+
382+
steps:
383+
- uses: actions/checkout@v4
384+
385+
- name: Setup Boost
386+
shell: cmd
387+
run: |
388+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
389+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
390+
echo LIBRARY: %LIBRARY%
391+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
392+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
393+
echo GITHUB_REF: %GITHUB_REF%
394+
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
395+
set BOOST_BRANCH=develop
396+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
397+
echo BOOST_BRANCH: %BOOST_BRANCH%
398+
cd ..
399+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
400+
cd boost-root
401+
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
402+
git submodule update --init tools/boostdep
403+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
404+
405+
- name: Configure
406+
shell: cmd
407+
run: |
408+
cd ../boost-root
409+
mkdir __build__ && cd __build__
410+
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
411+
412+
- name: Install (Debug)
413+
shell: cmd
414+
run: |
415+
cd ../boost-root/__build__
416+
cmake --build . --target install --config Debug
417+
418+
- name: Install (Release)
419+
shell: cmd
420+
run: |
421+
cd ../boost-root/__build__
422+
cmake --build . --target install --config Release
423+
424+
- name: Use the installed library (Debug)
425+
shell: cmd
426+
run: |
427+
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
428+
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
429+
cmake --build . --config Debug
430+
PATH C:\cmake-prefix\bin;%PATH%
431+
ctest --output-on-failure --no-tests=error -C Debug
432+
433+
- name: Use the installed library (Release)
434+
shell: cmd
435+
run: |
436+
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
437+
cmake --build . --config Release
438+
PATH C:\cmake-prefix\bin;%PATH%
439+
ctest --output-on-failure --no-tests=error -C Release
440+
441+
windows-cmake-test:
442+
strategy:
443+
fail-fast: false
444+
matrix:
445+
os: [ windows-2019, windows-2022 ]
446+
shared: [ OFF, ON ]
447+
448+
runs-on: ${{matrix.os}}
449+
450+
steps:
451+
- uses: actions/checkout@v4
452+
453+
- name: Setup Boost
454+
shell: cmd
455+
run: |
456+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
457+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
458+
echo LIBRARY: %LIBRARY%
459+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
460+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
461+
echo GITHUB_REF: %GITHUB_REF%
462+
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
463+
set BOOST_BRANCH=develop
464+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
465+
echo BOOST_BRANCH: %BOOST_BRANCH%
466+
cd ..
467+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
468+
cd boost-root
469+
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
470+
git submodule update --init tools/boostdep
471+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
472+
473+
- name: Configure
474+
shell: cmd
475+
run: |
476+
cd ../boost-root
477+
mkdir __build__ && cd __build__
478+
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
479+
480+
- name: Build tests (Debug)
481+
shell: cmd
482+
run: |
483+
cd ../boost-root/__build__
484+
cmake --build . --target tests --config Debug
485+
486+
- name: Run tests (Debug)
487+
shell: cmd
488+
run: |
489+
cd ../boost-root/__build__
490+
ctest --output-on-failure --no-tests=error -C Debug
491+
492+
- name: Build tests (Release)
493+
shell: cmd
494+
run: |
495+
cd ../boost-root/__build__
496+
cmake --build . --target tests --config Release
497+
498+
- name: Run tests (Release)
499+
shell: cmd
500+
run: |
501+
cd ../boost-root/__build__
502+
ctest --output-on-failure --no-tests=error -C Release

0 commit comments

Comments
 (0)