Skip to content

Commit 56a3acc

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 d4d5d36 commit 56a3acc

File tree

1 file changed

+32
-12
lines changed

1 file changed

+32
-12
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 Andrey Semashev
1+
# Copyright 2023-2024 Andrey Semashev
22
#
33
# Distributed under the Boost Software License, Version 1.0.
44
# https://www.boost.org/LICENSE_1_0.txt
@@ -313,8 +313,6 @@ jobs:
313313
fi
314314
git config --global pack.threads 0
315315
316-
- uses: actions/checkout@v3
317-
318316
- name: Install packages
319317
if: matrix.install
320318
run: |
@@ -429,11 +427,23 @@ jobs:
429427
then
430428
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
431429
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"
432442
cd ..
433443
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
434444
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"
437447
git submodule update --init tools/boostdep
438448
DEPINST_ARGS+=("$LIBRARY")
439449
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
@@ -455,7 +465,7 @@ jobs:
455465
- name: Run tests
456466
if: matrix.cmake_tests == ''
457467
run: |
458-
cd ../boost-root
468+
cd boost-root
459469
if [ -z "${{matrix.extra_tests}}" ]
460470
then
461471
export BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
@@ -490,15 +500,15 @@ jobs:
490500
- name: Build CMake tests
491501
if: matrix.cmake_tests
492502
run: |
493-
cd ../boost-root
503+
cd boost-root
494504
mkdir __build_static__ && cd __build_static__
495505
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
496506
cmake --build . --target tests -j $BUILD_JOBS
497507
498508
- name: Run CMake tests
499509
if: matrix.cmake_tests
500510
run: |
501-
cd ../boost-root
511+
cd boost-root
502512
cd __build_static__
503513
ctest --output-on-failure --no-tests=error
504514
@@ -533,8 +543,6 @@ jobs:
533543
runs-on: ${{matrix.os}}
534544

535545
steps:
536-
- uses: actions/checkout@v3
537-
538546
- name: Setup Boost
539547
shell: cmd
540548
run: |
@@ -548,10 +556,22 @@ jobs:
548556
set BOOST_BRANCH=develop
549557
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
550558
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"
551570
cd ..
552571
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
553572
cd boost-root
554-
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
573+
mkdir libs
574+
move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
555575
git submodule update --init tools/boostdep
556576
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
557577
cmd /c bootstrap
@@ -560,7 +580,7 @@ jobs:
560580
- name: Run tests
561581
shell: cmd
562582
run: |
563-
cd ../boost-root
583+
cd boost-root
564584
if "${{matrix.extra_tests}}" == "" set BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
565585
if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}}
566586
if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}}

0 commit comments

Comments
 (0)