1
- # Copyright 2021-2023 Andrey Semashev
1
+ # Copyright 2021-2024 Andrey Semashev
2
2
#
3
3
# Distributed under the Boost Software License, Version 1.0.
4
4
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
@@ -493,8 +493,6 @@ jobs:
493
493
fi
494
494
git config --global pack.threads 0
495
495
496
- - uses : actions/checkout@v3
497
-
498
496
- name : Install packages
499
497
if : matrix.install
500
498
run : |
@@ -609,11 +607,25 @@ jobs:
609
607
then
610
608
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
611
609
fi
610
+ mkdir -p snapshot
611
+ cd snapshot
612
+ echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
613
+ curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
614
+ tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
615
+ if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
616
+ then
617
+ echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
618
+ ls -la
619
+ exit 1
620
+ fi
621
+ rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
612
622
cd ..
613
623
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
614
624
cd boost-root
615
- mkdir -p libs/$LIBRARY
616
- cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
625
+ [ -d libs ] || mkdir -p libs
626
+ rm -rf "libs/$LIBRARY"
627
+ mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
628
+ rm -rf "../snapshot"
617
629
git submodule update --init tools/boostdep
618
630
DEPINST_ARGS+=("$LIBRARY")
619
631
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
@@ -635,7 +647,7 @@ jobs:
635
647
- name : Run tests
636
648
if : matrix.cmake_tests == ''
637
649
run : |
638
- cd ../ boost-root
650
+ cd boost-root
639
651
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}")
640
652
if [ -n "${{matrix.build_variant}}" ]
641
653
then
@@ -690,7 +702,7 @@ jobs:
690
702
then
691
703
export MACOSX_DEPLOYMENT_TARGET="${{matrix.macosx_version_min}}"
692
704
fi
693
- cd ../ boost-root
705
+ cd boost-root
694
706
mkdir __build_static__ && cd __build_static__
695
707
cmake ../libs/$LIBRARY/test/test_cmake
696
708
cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS
@@ -740,8 +752,6 @@ jobs:
740
752
runs-on : ${{matrix.os}}
741
753
742
754
steps :
743
- - uses : actions/checkout@v3
744
-
745
755
- name : Setup Boost
746
756
run : |
747
757
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
@@ -754,10 +764,24 @@ jobs:
754
764
set BOOST_BRANCH=develop
755
765
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
756
766
echo BOOST_BRANCH: %BOOST_BRANCH%
767
+ mkdir snapshot
768
+ cd snapshot
769
+ echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
770
+ curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
771
+ tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
772
+ if not exist "%LIBRARY%-%GITHUB_SHA%\" (
773
+ echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
774
+ dir
775
+ exit /b 1
776
+ )
777
+ del /f "%LIBRARY%-%GITHUB_SHA%.zip"
757
778
cd ..
758
779
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
759
780
cd boost-root
760
- xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
781
+ if not exist "libs\" mkdir libs
782
+ rmdir /s /q "libs\%LIBRARY%"
783
+ move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
784
+ rmdir /s /q "..\snapshot"
761
785
git submodule update --init tools/boostdep
762
786
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
763
787
if "${{matrix.cmake_tests}}" == "" (
@@ -768,7 +792,7 @@ jobs:
768
792
- name : Run tests
769
793
if : matrix.cmake_tests == ''
770
794
run : |
771
- cd ../ boost-root
795
+ cd boost-root
772
796
set "B2_ARGS=-j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} embed-manifest-via=linker"
773
797
if not "${{matrix.build_variant}}" == "" ( set "B2_ARGS=%B2_ARGS% variant=${{matrix.build_variant}}" ) else ( set "B2_ARGS=%B2_ARGS% variant=%DEFAULT_BUILD_VARIANT%" )
774
798
if not "${{matrix.instruction_set}}" == "" ( set "B2_ARGS=%B2_ARGS% instruction-set=${{matrix.instruction_set}}" ) else ( set "B2_ARGS=%B2_ARGS% instruction-set=%DEFAULT_INSTRUCTION_SET%" )
@@ -792,7 +816,7 @@ jobs:
792
816
- name : Run CMake tests
793
817
if : matrix.cmake_tests
794
818
run : |
795
- cd ../ boost-root
819
+ cd boost-root
796
820
mkdir __build_static__
797
821
cd __build_static__
798
822
cmake ../libs/%LIBRARY%/test/test_cmake
0 commit comments