@@ -324,8 +324,6 @@ jobs:
324
324
fi
325
325
git config --global pack.threads 0
326
326
327
- - uses : actions/checkout@v3
328
-
329
327
- name : Install packages
330
328
if : matrix.install
331
329
run : |
@@ -440,11 +438,25 @@ jobs:
440
438
then
441
439
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
442
440
fi
441
+ mkdir -p snapshot
442
+ cd snapshot
443
+ echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
444
+ curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
445
+ tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
446
+ if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
447
+ then
448
+ echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
449
+ ls -la
450
+ exit 1
451
+ fi
452
+ rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
443
453
cd ..
444
454
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
445
455
cd boost-root
446
- mkdir -p libs/$LIBRARY
447
- cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
456
+ mkdir -p libs
457
+ rm -rf "libs/$LIBRARY"
458
+ mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
459
+ rm -rf "../snapshot"
448
460
git submodule update --init tools/boostdep
449
461
if [ -n "${{matrix.extra_tests}}" ]
450
462
then
@@ -470,7 +482,7 @@ jobs:
470
482
- name : Run tests
471
483
if : matrix.cmake_tests == ''
472
484
run : |
473
- cd ../ boost-root
485
+ cd boost-root
474
486
if [ -n "${{matrix.extra_tests}}" ]
475
487
then
476
488
export BOOST_FILESYSTEM_TEST_WITH_EXAMPLES=1
@@ -505,7 +517,7 @@ jobs:
505
517
- name : Run CMake tests
506
518
if : matrix.cmake_tests
507
519
run : |
508
- cd ../ boost-root
520
+ cd boost-root
509
521
mkdir __build_static__ && cd __build_static__
510
522
cmake ../libs/$LIBRARY/test/test_cmake
511
523
cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS
@@ -548,8 +560,6 @@ jobs:
548
560
runs-on : ${{matrix.os}}
549
561
550
562
steps :
551
- - uses : actions/checkout@v3
552
-
553
563
- name : Setup Boost
554
564
run : |
555
565
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
@@ -562,10 +572,24 @@ jobs:
562
572
set BOOST_BRANCH=develop
563
573
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
564
574
echo BOOST_BRANCH: %BOOST_BRANCH%
575
+ mkdir snapshot
576
+ cd snapshot
577
+ echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
578
+ curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
579
+ tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
580
+ if not exist "%LIBRARY%-%GITHUB_SHA%\" (
581
+ echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
582
+ dir
583
+ exit /b 1
584
+ )
585
+ del /f "%LIBRARY%-%GITHUB_SHA%.zip"
565
586
cd ..
566
587
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
567
588
cd boost-root
568
- xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
589
+ if not exist "libs\" mkdir libs
590
+ if exist "libs\%LIBRARY%\" rmdir /s /q "libs\%LIBRARY%"
591
+ move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
592
+ rmdir /s /q "..\snapshot"
569
593
git submodule update --init tools/boostdep
570
594
if not "${{matrix.extra_tests}}" == "" set DEPINST_ARG_INCLUDE_EXAMPLES="--include=example"
571
595
python tools/boostdep/depinst/depinst.py %DEPINST_ARG_INCLUDE_EXAMPLES% --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
@@ -577,7 +601,7 @@ jobs:
577
601
- name : Run tests
578
602
if : matrix.cmake_tests == ''
579
603
run : |
580
- cd ../ boost-root
604
+ cd boost-root
581
605
set "B2_ARGS=-j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} embed-manifest-via=linker"
582
606
if not "${{matrix.cxxstd}}" == "" set "B2_ARGS=%B2_ARGS% ^"cxxstd=${{matrix.cxxstd}}^""
583
607
if not "${{matrix.build_variant}}" == "" ( set "B2_ARGS=%B2_ARGS% variant=${{matrix.build_variant}}" ) else ( set "B2_ARGS=%B2_ARGS% variant=%DEFAULT_BUILD_VARIANT%" )
@@ -589,7 +613,7 @@ jobs:
589
613
- name : Run CMake tests
590
614
if : matrix.cmake_tests
591
615
run : |
592
- cd ../ boost-root
616
+ cd boost-root
593
617
mkdir __build_static__
594
618
cd __build_static__
595
619
cmake ../libs/%LIBRARY%/test/test_cmake
0 commit comments