Skip to content

Commit 43ba867

Browse files
committed
Add cmake subdir and install tests to CI
1 parent cca3167 commit 43ba867

1 file changed

Lines changed: 169 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,175 @@ jobs:
486486
cd ../boost-root/__build__
487487
cmake --build . --target tests
488488
489+
posix-cmake-subdir:
490+
strategy:
491+
fail-fast: false
492+
matrix:
493+
include:
494+
- os: ubuntu-22.04
495+
- os: ubuntu-24.04
496+
- os: macos-15
497+
498+
runs-on: ${{matrix.os}}
499+
500+
steps:
501+
- uses: actions/checkout@v4
502+
503+
- name: Use library with add_subdirectory (header-only)
504+
run: |
505+
cd test/cmake_subdir_test
506+
mkdir __build__ && cd __build__
507+
cmake ..
508+
cmake --build .
509+
ctest --output-on-failure --no-tests=error
510+
511+
posix-cmake-subdir-legacy:
512+
strategy:
513+
fail-fast: false
514+
matrix:
515+
include:
516+
- os: ubuntu-22.04
517+
- os: ubuntu-24.04
518+
- os: macos-15
519+
520+
runs-on: ${{matrix.os}}
521+
522+
steps:
523+
- uses: actions/checkout@v4
524+
525+
- name: Setup Boost
526+
run: |
527+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
528+
LIBRARY=${GITHUB_REPOSITORY#*/}
529+
echo LIBRARY: $LIBRARY
530+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
531+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
532+
echo GITHUB_REF: $GITHUB_REF
533+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
534+
REF=${REF#refs/heads/}
535+
echo REF: $REF
536+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
537+
echo BOOST_BRANCH: $BOOST_BRANCH
538+
cd ..
539+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
540+
cd boost-root
541+
mkdir -p libs/$LIBRARY
542+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
543+
git submodule update --init tools/boostdep
544+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
545+
546+
- name: Use library with add_subdirectory (legacy compiled)
547+
run: |
548+
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test_legacy
549+
mkdir __build__ && cd __build__
550+
cmake ..
551+
cmake --build .
552+
ctest --output-on-failure --no-tests=error
553+
554+
posix-cmake-install:
555+
strategy:
556+
fail-fast: false
557+
matrix:
558+
include:
559+
- os: macos-15
560+
561+
runs-on: ${{matrix.os}}
562+
563+
steps:
564+
- uses: actions/checkout@v4
565+
566+
- name: Setup Boost
567+
run: |
568+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
569+
LIBRARY=${GITHUB_REPOSITORY#*/}
570+
echo LIBRARY: $LIBRARY
571+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
572+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
573+
echo GITHUB_REF: $GITHUB_REF
574+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
575+
REF=${REF#refs/heads/}
576+
echo REF: $REF
577+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
578+
echo BOOST_BRANCH: $BOOST_BRANCH
579+
cd ..
580+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
581+
cd boost-root
582+
mkdir -p libs/$LIBRARY
583+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
584+
git submodule update --init tools/boostdep
585+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
586+
587+
- name: Configure
588+
run: |
589+
cd ../boost-root
590+
mkdir __build__ && cd __build__
591+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
592+
593+
- name: Install
594+
run: |
595+
cd ../boost-root/__build__
596+
cmake --build . --target install
597+
598+
- name: Use the installed library (header-only)
599+
run: |
600+
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test
601+
mkdir __build__ && cd __build__
602+
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
603+
cmake --build .
604+
ctest --output-on-failure --no-tests=error
605+
606+
posix-cmake-install-legacy:
607+
strategy:
608+
fail-fast: false
609+
matrix:
610+
include:
611+
- os: macos-15
612+
613+
runs-on: ${{matrix.os}}
614+
615+
steps:
616+
- uses: actions/checkout@v4
617+
618+
- name: Setup Boost
619+
run: |
620+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
621+
LIBRARY=${GITHUB_REPOSITORY#*/}
622+
echo LIBRARY: $LIBRARY
623+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
624+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
625+
echo GITHUB_REF: $GITHUB_REF
626+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
627+
REF=${REF#refs/heads/}
628+
echo REF: $REF
629+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
630+
echo BOOST_BRANCH: $BOOST_BRANCH
631+
cd ..
632+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
633+
cd boost-root
634+
mkdir -p libs/$LIBRARY
635+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
636+
git submodule update --init tools/boostdep
637+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
638+
639+
- name: Configure
640+
run: |
641+
cd ../boost-root
642+
mkdir __build__ && cd __build__
643+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS=ON -DCMAKE_INSTALL_PREFIX=~/.local ..
644+
645+
- name: Install
646+
run: |
647+
cd ../boost-root/__build__
648+
cmake --build . --target install
649+
650+
- name: Use the installed library (legacy compiled)
651+
run: |
652+
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test_legacy
653+
mkdir __build__ && cd __build__
654+
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
655+
cmake --build .
656+
ctest --output-on-failure --no-tests=error
657+
489658
sycl-cmake-test:
490659
strategy:
491660
fail-fast: false

0 commit comments

Comments
 (0)