diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4eb76717..e8b6d73d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -638,3 +638,105 @@ jobs: cmake -DBUILD_SHARED_LIBS=On ../libs/%LIBRARY%/test/test_cmake cmake --build . --target boost_%LIBRARY%_cmake_self_test -j %NUMBER_OF_PROCESSORS% cmake --build . --target boost_%LIBRARY%_setup_cmake_self_test -j %NUMBER_OF_PROCESSORS% + + cygwin: + defaults: + run: + shell: bash + + env: + SHELLOPTS: igncr + + strategy: + fail-fast: false + matrix: + include: + - toolset: gcc + cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu" + os: windows-2022 + + timeout-minutes: 60 + runs-on: ${{matrix.os}} + + steps: + - name: Install Cygwin + uses: cygwin/cygwin-install-action@v4 + with: + packages: + gcc-g++ + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + BUILD_JOBS=$((nproc) 2> /dev/null) + echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV + echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV + DEPINST_ARGS=("--git_args" "--jobs $GIT_FETCH_JOBS") + mkdir -p snapshot + cd snapshot + echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz" + if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ] + then + echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:" + ls -la + exit 1 + fi + rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz" + cd .. + git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" + cd boost-root + mkdir -p libs + rm -rf "libs/$LIBRARY" + mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY" + rm -rf "../snapshot" + git submodule update --init tools/boostdep + if [ -n "${{matrix.extra_tests}}" ] + then + DEPINST_ARGS+=("--include" "example") + fi + DEPINST_ARGS+=("$LIBRARY") + python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" + ./bootstrap.sh + ./b2 -d0 headers + + - name: Run tests + run: | + cd boost-root + if [ -z "${{matrix.extra_tests}}" ] + then + export BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1 + export BOOST_LOG_TEST_WITHOUT_EXAMPLES=1 + fi + B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}") + if [ -n "${{matrix.build_variant}}" ] + then + B2_ARGS+=("variant=${{matrix.build_variant}}") + else + B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") + fi + if [ -n "${{matrix.threading}}" ] + then + B2_ARGS+=("threading=${{matrix.threading}}") + fi + if [ -n "${{matrix.cxxflags}}" ] + then + B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") + fi + if [ -n "${{matrix.linkflags}}" ] + then + B2_ARGS+=("linkflags=${{matrix.linkflags}}") + fi + B2_ARGS+=("libs/$LIBRARY/test") + ./b2 "${B2_ARGS[@]}"