Skip to content

Commit 8d4492d

Browse files
committed
Added a Cygwin job to GitHub Actions.
Only test C++14 and up and only debug builds since building and running tests on Cygwin is extra slow.
1 parent 3dacd00 commit 8d4492d

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,3 +638,106 @@ jobs:
638638
cmake -DBUILD_SHARED_LIBS=On ../libs/%LIBRARY%/test/test_cmake
639639
cmake --build . --target boost_%LIBRARY%_cmake_self_test -j %NUMBER_OF_PROCESSORS%
640640
cmake --build . --target boost_%LIBRARY%_setup_cmake_self_test -j %NUMBER_OF_PROCESSORS%
641+
642+
cygwin:
643+
defaults:
644+
run:
645+
shell: bash
646+
647+
env:
648+
SHELLOPTS: igncr
649+
650+
strategy:
651+
fail-fast: false
652+
matrix:
653+
include:
654+
- toolset: gcc
655+
cxxstd: "14-gnu,17-gnu,20-gnu,23-gnu"
656+
build_variant: debug
657+
os: windows-2022
658+
659+
timeout-minutes: 60
660+
runs-on: ${{matrix.os}}
661+
662+
steps:
663+
- name: Install Cygwin
664+
uses: cygwin/cygwin-install-action@v4
665+
with:
666+
packages:
667+
gcc-g++
668+
669+
- name: Setup Boost
670+
run: |
671+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
672+
LIBRARY=${GITHUB_REPOSITORY#*/}
673+
echo LIBRARY: $LIBRARY
674+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
675+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
676+
echo GITHUB_REF: $GITHUB_REF
677+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
678+
REF=${REF#refs/heads/}
679+
echo REF: $REF
680+
BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
681+
echo BOOST_BRANCH: $BOOST_BRANCH
682+
BUILD_JOBS=$((nproc) 2> /dev/null)
683+
echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV
684+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV
685+
DEPINST_ARGS=("--git_args" "--jobs $GIT_FETCH_JOBS")
686+
mkdir -p snapshot
687+
cd snapshot
688+
echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
689+
curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
690+
tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
691+
if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
692+
then
693+
echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
694+
ls -la
695+
exit 1
696+
fi
697+
rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
698+
cd ..
699+
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
700+
cd boost-root
701+
mkdir -p libs
702+
rm -rf "libs/$LIBRARY"
703+
mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
704+
rm -rf "../snapshot"
705+
git submodule update --init tools/boostdep
706+
if [ -n "${{matrix.extra_tests}}" ]
707+
then
708+
DEPINST_ARGS+=("--include" "example")
709+
fi
710+
DEPINST_ARGS+=("$LIBRARY")
711+
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
712+
./bootstrap.sh
713+
./b2 -d0 headers
714+
715+
- name: Run tests
716+
run: |
717+
cd boost-root
718+
if [ -z "${{matrix.extra_tests}}" ]
719+
then
720+
export BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
721+
export BOOST_LOG_TEST_WITHOUT_EXAMPLES=1
722+
fi
723+
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}")
724+
if [ -n "${{matrix.build_variant}}" ]
725+
then
726+
B2_ARGS+=("variant=${{matrix.build_variant}}")
727+
else
728+
B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT")
729+
fi
730+
if [ -n "${{matrix.threading}}" ]
731+
then
732+
B2_ARGS+=("threading=${{matrix.threading}}")
733+
fi
734+
if [ -n "${{matrix.cxxflags}}" ]
735+
then
736+
B2_ARGS+=("cxxflags=${{matrix.cxxflags}}")
737+
fi
738+
if [ -n "${{matrix.linkflags}}" ]
739+
then
740+
B2_ARGS+=("linkflags=${{matrix.linkflags}}")
741+
fi
742+
B2_ARGS+=("libs/$LIBRARY/test")
743+
./b2 "${B2_ARGS[@]}"

0 commit comments

Comments
 (0)