@@ -306,8 +306,6 @@ jobs:
306
306
fi
307
307
git config --global pack.threads 0
308
308
309
- - uses : actions/checkout@v3
310
-
311
309
- name : Install packages
312
310
if : matrix.install
313
311
run : |
@@ -422,11 +420,25 @@ jobs:
422
420
then
423
421
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
424
422
fi
423
+ mkdir -p snapshot
424
+ cd snapshot
425
+ echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
426
+ curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
427
+ tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
428
+ if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
429
+ then
430
+ echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
431
+ ls -la
432
+ exit 1
433
+ fi
434
+ rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
425
435
cd ..
426
436
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
427
437
cd boost-root
428
- mkdir -p libs/$LIBRARY
429
- cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
438
+ mkdir -p libs
439
+ rm -rf "libs/$LIBRARY"
440
+ mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
441
+ rm -rf "../snapshot"
430
442
git submodule update --init tools/boostdep
431
443
if [ -n "${{matrix.extra_tests}}" ]
432
444
then
@@ -452,7 +464,7 @@ jobs:
452
464
- name : Run tests
453
465
if : matrix.cmake_tests == ''
454
466
run : |
455
- cd ../ boost-root
467
+ cd boost-root
456
468
if [ -z "${{matrix.extra_tests}}" ]
457
469
then
458
470
export BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
@@ -488,7 +500,7 @@ jobs:
488
500
- name : Run CMake tests
489
501
if : matrix.cmake_tests
490
502
run : |
491
- cd ../ boost-root
503
+ cd boost-root
492
504
mkdir __build_static__ && cd __build_static__
493
505
cmake ../libs/$LIBRARY/test/test_cmake
494
506
cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS
@@ -533,8 +545,6 @@ jobs:
533
545
runs-on : ${{matrix.os}}
534
546
535
547
steps :
536
- - uses : actions/checkout@v3
537
-
538
548
- name : Setup Boost
539
549
run : |
540
550
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
@@ -547,10 +557,24 @@ jobs:
547
557
set BOOST_BRANCH=develop
548
558
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
549
559
echo BOOST_BRANCH: %BOOST_BRANCH%
560
+ mkdir snapshot
561
+ cd snapshot
562
+ echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
563
+ curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
564
+ tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
565
+ if not exist "%LIBRARY%-%GITHUB_SHA%\" (
566
+ echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
567
+ dir
568
+ exit /b 1
569
+ )
570
+ del /f "%LIBRARY%-%GITHUB_SHA%.zip"
550
571
cd ..
551
572
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
552
573
cd boost-root
553
- xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
574
+ if not exist "libs\" mkdir libs
575
+ if exist "libs\%LIBRARY%\" rmdir /s /q "libs\%LIBRARY%"
576
+ move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
577
+ rmdir /s /q "..\snapshot"
554
578
git submodule update --init tools/boostdep
555
579
if not "${{matrix.extra_tests}}" == "" set DEPINST_ARG_INCLUDE_EXAMPLES="--include=example"
556
580
python tools/boostdep/depinst/depinst.py %DEPINST_ARG_INCLUDE_EXAMPLES% --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
@@ -562,7 +586,7 @@ jobs:
562
586
- name : Run tests
563
587
if : matrix.cmake_tests == ''
564
588
run : |
565
- cd ../ boost-root
589
+ cd boost-root
566
590
set "B2_ARGS=-j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} embed-manifest-via=linker"
567
591
if not "${{matrix.cxxstd}}" == "" set "B2_ARGS=%B2_ARGS% ^"cxxstd=${{matrix.cxxstd}}^""
568
592
if not "${{matrix.build_variant}}" == "" ( set "B2_ARGS=%B2_ARGS% variant=${{matrix.build_variant}}" ) else ( set "B2_ARGS=%B2_ARGS% variant=%DEFAULT_BUILD_VARIANT%" )
@@ -577,7 +601,7 @@ jobs:
577
601
- name : Run CMake tests
578
602
if : matrix.cmake_tests
579
603
run : |
580
- cd ../ boost-root
604
+ cd boost-root
581
605
mkdir __build_static__
582
606
cd __build_static__
583
607
cmake ../libs/%LIBRARY%/test/test_cmake
0 commit comments