1
- # Copyright 2023 Andrey Semashev
1
+ # Copyright 2023-2024 Andrey Semashev
2
2
#
3
3
# Distributed under the Boost Software License, Version 1.0.
4
4
# https://www.boost.org/LICENSE_1_0.txt
@@ -313,8 +313,6 @@ jobs:
313
313
fi
314
314
git config --global pack.threads 0
315
315
316
- - uses : actions/checkout@v3
317
-
318
316
- name : Install packages
319
317
if : matrix.install
320
318
run : |
@@ -429,11 +427,23 @@ jobs:
429
427
then
430
428
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
431
429
fi
430
+ mkdir -p snapshot
431
+ cd snapshot
432
+ echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
433
+ curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
434
+ tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
435
+ if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
436
+ then
437
+ echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
438
+ ls -la
439
+ exit 1
440
+ fi
441
+ rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
432
442
cd ..
433
443
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
434
444
cd boost-root
435
- mkdir -p libs/$LIBRARY
436
- cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
445
+ mkdir -p libs
446
+ mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" " libs/$LIBRARY"
437
447
git submodule update --init tools/boostdep
438
448
DEPINST_ARGS+=("$LIBRARY")
439
449
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
@@ -455,7 +465,7 @@ jobs:
455
465
- name : Run tests
456
466
if : matrix.cmake_tests == ''
457
467
run : |
458
- cd ../ boost-root
468
+ cd boost-root
459
469
if [ -z "${{matrix.extra_tests}}" ]
460
470
then
461
471
export BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
@@ -490,15 +500,15 @@ jobs:
490
500
- name : Build CMake tests
491
501
if : matrix.cmake_tests
492
502
run : |
493
- cd ../ boost-root
503
+ cd boost-root
494
504
mkdir __build_static__ && cd __build_static__
495
505
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
496
506
cmake --build . --target tests -j $BUILD_JOBS
497
507
498
508
- name : Run CMake tests
499
509
if : matrix.cmake_tests
500
510
run : |
501
- cd ../ boost-root
511
+ cd boost-root
502
512
cd __build_static__
503
513
ctest --output-on-failure --no-tests=error
504
514
@@ -533,8 +543,6 @@ jobs:
533
543
runs-on : ${{matrix.os}}
534
544
535
545
steps :
536
- - uses : actions/checkout@v3
537
-
538
546
- name : Setup Boost
539
547
shell : cmd
540
548
run : |
@@ -548,10 +556,22 @@ jobs:
548
556
set BOOST_BRANCH=develop
549
557
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
550
558
echo BOOST_BRANCH: %BOOST_BRANCH%
559
+ mkdir snapshot
560
+ cd snapshot
561
+ echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
562
+ curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
563
+ tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
564
+ if not exist "%LIBRARY%-%GITHUB_SHA%\" (
565
+ echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
566
+ dir
567
+ exit /b 1
568
+ )
569
+ del /f "%LIBRARY%-%GITHUB_SHA%.zip"
551
570
cd ..
552
571
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
553
572
cd boost-root
554
- xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
573
+ mkdir libs
574
+ move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
555
575
git submodule update --init tools/boostdep
556
576
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
557
577
cmd /c bootstrap
@@ -560,7 +580,7 @@ jobs:
560
580
- name : Run tests
561
581
shell : cmd
562
582
run : |
563
- cd ../ boost-root
583
+ cd boost-root
564
584
if "${{matrix.extra_tests}}" == "" set BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
565
585
if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}}
566
586
if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}}
0 commit comments