Skip to content

Commit 55fb00c

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 a10762e commit 55fb00c

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
@@ -324,8 +324,6 @@ jobs:
324324
fi
325325
git config --global pack.threads 0
326326
327-
- uses: actions/checkout@v3
328-
329327
- name: Install packages
330328
if: matrix.install
331329
run: |
@@ -440,11 +438,25 @@ jobs:
440438
then
441439
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
442440
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"
443453
cd ..
444454
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
445455
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"
448460
git submodule update --init tools/boostdep
449461
if [ -n "${{matrix.extra_tests}}" ]
450462
then
@@ -470,7 +482,7 @@ jobs:
470482
- name: Run tests
471483
if: matrix.cmake_tests == ''
472484
run: |
473-
cd ../boost-root
485+
cd boost-root
474486
if [ -n "${{matrix.extra_tests}}" ]
475487
then
476488
export BOOST_FILESYSTEM_TEST_WITH_EXAMPLES=1
@@ -505,7 +517,7 @@ jobs:
505517
- name: Run CMake tests
506518
if: matrix.cmake_tests
507519
run: |
508-
cd ../boost-root
520+
cd boost-root
509521
mkdir __build_static__ && cd __build_static__
510522
cmake ../libs/$LIBRARY/test/test_cmake
511523
cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS
@@ -548,8 +560,6 @@ jobs:
548560
runs-on: ${{matrix.os}}
549561

550562
steps:
551-
- uses: actions/checkout@v3
552-
553563
- name: Setup Boost
554564
run: |
555565
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
@@ -562,10 +572,24 @@ jobs:
562572
set BOOST_BRANCH=develop
563573
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
564574
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"
565586
cd ..
566587
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
567588
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"
569593
git submodule update --init tools/boostdep
570594
if not "${{matrix.extra_tests}}" == "" set DEPINST_ARG_INCLUDE_EXAMPLES="--include=example"
571595
python tools/boostdep/depinst/depinst.py %DEPINST_ARG_INCLUDE_EXAMPLES% --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
@@ -577,7 +601,7 @@ jobs:
577601
- name: Run tests
578602
if: matrix.cmake_tests == ''
579603
run: |
580-
cd ../boost-root
604+
cd boost-root
581605
set "B2_ARGS=-j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} embed-manifest-via=linker"
582606
if not "${{matrix.cxxstd}}" == "" set "B2_ARGS=%B2_ARGS% ^"cxxstd=${{matrix.cxxstd}}^""
583607
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:
589613
- name: Run CMake tests
590614
if: matrix.cmake_tests
591615
run: |
592-
cd ../boost-root
616+
cd boost-root
593617
mkdir __build_static__
594618
cd __build_static__
595619
cmake ../libs/%LIBRARY%/test/test_cmake

0 commit comments

Comments
 (0)