Skip to content

Commit 40ab6f4

Browse files
committed
Add cygwin regression test
1 parent 5048d26 commit 40ab6f4

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

.github/workflows/ci.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,3 +725,135 @@ jobs:
725725
cd boost-root
726726
b2 -j %NUMBER_OF_PROCESSORS% libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker debug-symbols=off
727727
728+
cygwin:
729+
defaults:
730+
run:
731+
shell: bash
732+
733+
strategy:
734+
fail-fast: false
735+
matrix:
736+
include:
737+
- toolset: gcc
738+
cxxstd: "03,11,14,17"
739+
cxxflags: -pipe
740+
os: windows-latest
741+
742+
timeout-minutes: 240
743+
runs-on: ${{matrix.os}}
744+
container: ${{matrix.container}}
745+
746+
steps:
747+
- name: Setup environment
748+
uses: cygwin/cygwin-install-action@master
749+
with:
750+
packages: gcc-g++ make python3 git wget curl
751+
- name: Setup Boost
752+
shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
753+
run: |
754+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
755+
LIBRARY=${GITHUB_REPOSITORY#*/}
756+
echo LIBRARY: $LIBRARY
757+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
758+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
759+
echo GITHUB_REF: $GITHUB_REF
760+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
761+
REF=${REF#refs/heads/}
762+
echo REF: $REF
763+
BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
764+
echo BOOST_BRANCH: $BOOST_BRANCH
765+
BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null)
766+
echo BUILD_JOBS: $BUILD_JOBS
767+
echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV
768+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV
769+
DEPINST_ARGS=()
770+
GIT_VERSION="$(git --version | sed -e 's/git version //')"
771+
GIT_HAS_JOBS=1
772+
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
773+
mkdir -p snapshot
774+
cd snapshot
775+
echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
776+
curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
777+
tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
778+
if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
779+
then
780+
echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
781+
ls -la
782+
exit 1
783+
fi
784+
rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
785+
cd ..
786+
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
787+
cd boost-root
788+
mkdir -p libs
789+
rm -rf "libs/$LIBRARY"
790+
mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
791+
rm -rf "../snapshot"
792+
git submodule update --init tools/boostdep
793+
DEPINST_ARGS+=("$LIBRARY")
794+
python tools/boostdep/depinst/depinst.py -C "${DEPINST_ARGS[@]}"
795+
./bootstrap.sh
796+
./b2 headers
797+
if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ]
798+
then
799+
echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam
800+
if [ -n "$GCC_TOOLCHAIN_ROOT" ]
801+
then
802+
echo -n " : <compileflags>\"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" <linkflags>\"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam
803+
fi
804+
echo " ;" >> ~/user-config.jam
805+
fi
806+
807+
- name: Run tests
808+
if: matrix.cmake_tests == ''
809+
shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
810+
run: |
811+
cd boost-root
812+
${{matrix.toolset}} --version
813+
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}" "debug-symbols=off")
814+
#Build variant
815+
if [ -n "${{matrix.build_variant}}" ]
816+
then
817+
B2_ARGS+=("variant=${{matrix.build_variant}}")
818+
else
819+
B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT")
820+
fi
821+
#Threading
822+
if [ -n "${{matrix.threading}}" ]
823+
then
824+
B2_ARGS+=("threading=${{matrix.threading}}")
825+
fi
826+
#UBSAN options
827+
if [ -n "${{matrix.ubsan}}" ]
828+
then
829+
export UBSAN_OPTIONS="verbosity=1:print_stacktrace=1"
830+
B2_ARGS+=("undefined-sanitizer=norecover" "define=UBSAN=1")
831+
fi
832+
#ASAN options
833+
if [ -n "${{matrix.asan}}" ]
834+
then
835+
export ASAN_OPTIONS="verbosity=1:print_stacktrace=1"
836+
B2_ARGS+=("address-sanitizer=norecover" "define=ASAN=1")
837+
fi
838+
#Common UBSAN / ASAN options
839+
if [ -n "${{matrix.asan}}" ] || [ -n "${{matrix.ubsan}}" ]
840+
then
841+
B2_ARGS+=("debug-symbols=on" "visibility=global")
842+
fi
843+
#cxxflags
844+
if [ -n "${{matrix.cxxflags}}" ]
845+
then
846+
B2_ARGS+=("cxxflags=${{matrix.cxxflags}}")
847+
fi
848+
#address-model
849+
if [ -n "${{matrix.address-model}}" ]
850+
then
851+
B2_ARGS+=("address-model=${{matrix.address-model}}")
852+
fi
853+
#link-flags
854+
if [ -n "${{matrix.linkflags}}" ]
855+
then
856+
B2_ARGS+=("linkflags=${{matrix.linkflags}}")
857+
fi
858+
B2_ARGS+=("libs/$LIBRARY/test")
859+
./b2 "${B2_ARGS[@]}"

0 commit comments

Comments
 (0)