Skip to content

Commit b9c4024

Browse files
committed
Replaced actions/checkout usage with manual download commands.
This fixes the deprecation warnings for actions/checkout@v3. actions/checkout@v4 is not functional because of the upstream bug: actions/checkout#1590
1 parent 8d16057 commit b9c4024

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,6 @@ jobs:
306306
fi
307307
git config --global pack.threads 0
308308
309-
- uses: actions/checkout@v3
310-
311309
- name: Install packages
312310
if: matrix.install
313311
run: |
@@ -422,11 +420,25 @@ jobs:
422420
then
423421
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
424422
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"
425435
cd ..
426436
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
427437
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"
430442
git submodule update --init tools/boostdep
431443
if [ -n "${{matrix.extra_tests}}" ]
432444
then
@@ -452,7 +464,7 @@ jobs:
452464
- name: Run tests
453465
if: matrix.cmake_tests == ''
454466
run: |
455-
cd ../boost-root
467+
cd boost-root
456468
if [ -z "${{matrix.extra_tests}}" ]
457469
then
458470
export BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
@@ -488,7 +500,7 @@ jobs:
488500
- name: Run CMake tests
489501
if: matrix.cmake_tests
490502
run: |
491-
cd ../boost-root
503+
cd boost-root
492504
mkdir __build_static__ && cd __build_static__
493505
cmake ../libs/$LIBRARY/test/test_cmake
494506
cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS
@@ -533,8 +545,6 @@ jobs:
533545
runs-on: ${{matrix.os}}
534546

535547
steps:
536-
- uses: actions/checkout@v3
537-
538548
- name: Setup Boost
539549
run: |
540550
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
@@ -547,10 +557,24 @@ jobs:
547557
set BOOST_BRANCH=develop
548558
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
549559
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"
550571
cd ..
551572
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
552573
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"
554578
git submodule update --init tools/boostdep
555579
if not "${{matrix.extra_tests}}" == "" set DEPINST_ARG_INCLUDE_EXAMPLES="--include=example"
556580
python tools/boostdep/depinst/depinst.py %DEPINST_ARG_INCLUDE_EXAMPLES% --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
@@ -562,7 +586,7 @@ jobs:
562586
- name: Run tests
563587
if: matrix.cmake_tests == ''
564588
run: |
565-
cd ../boost-root
589+
cd boost-root
566590
set "B2_ARGS=-j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} embed-manifest-via=linker"
567591
if not "${{matrix.cxxstd}}" == "" set "B2_ARGS=%B2_ARGS% ^"cxxstd=${{matrix.cxxstd}}^""
568592
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:
577601
- name: Run CMake tests
578602
if: matrix.cmake_tests
579603
run: |
580-
cd ../boost-root
604+
cd boost-root
581605
mkdir __build_static__
582606
cd __build_static__
583607
cmake ../libs/%LIBRARY%/test/test_cmake

0 commit comments

Comments
 (0)