Skip to content

Commit 56850f2

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 56850f2

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 14 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,21 @@ jobs:
429427
then
430428
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
431429
fi
432-
cd ..
433430
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
434431
cd boost-root
435-
mkdir -p libs/$LIBRARY
436-
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
432+
mkdir -p libs
433+
cd libs
434+
curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
435+
tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
436+
if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
437+
then
438+
echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
439+
ls -la
440+
exit 1
441+
fi
442+
rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
443+
mv -f "${LIBRARY}-${GITHUB_SHA}" "$LIBRARY"
444+
cd ..
437445
git submodule update --init tools/boostdep
438446
DEPINST_ARGS+=("$LIBRARY")
439447
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
@@ -455,7 +463,7 @@ jobs:
455463
- name: Run tests
456464
if: matrix.cmake_tests == ''
457465
run: |
458-
cd ../boost-root
466+
cd boost-root
459467
if [ -z "${{matrix.extra_tests}}" ]
460468
then
461469
export BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
@@ -490,15 +498,15 @@ jobs:
490498
- name: Build CMake tests
491499
if: matrix.cmake_tests
492500
run: |
493-
cd ../boost-root
501+
cd boost-root
494502
mkdir __build_static__ && cd __build_static__
495503
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
496504
cmake --build . --target tests -j $BUILD_JOBS
497505
498506
- name: Run CMake tests
499507
if: matrix.cmake_tests
500508
run: |
501-
cd ../boost-root
509+
cd boost-root
502510
cd __build_static__
503511
ctest --output-on-failure --no-tests=error
504512
@@ -533,8 +541,6 @@ jobs:
533541
runs-on: ${{matrix.os}}
534542

535543
steps:
536-
- uses: actions/checkout@v3
537-
538544
- name: Setup Boost
539545
shell: cmd
540546
run: |
@@ -548,10 +554,20 @@ jobs:
548554
set BOOST_BRANCH=develop
549555
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
550556
echo BOOST_BRANCH: %BOOST_BRANCH%
551-
cd ..
552557
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
553558
cd boost-root
554-
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
559+
mkdir libs
560+
cd libs
561+
curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
562+
tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
563+
if not exist "%LIBRARY%-%GITHUB_SHA%\" (
564+
echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
565+
dir
566+
exit /b 1
567+
)
568+
del /f "%LIBRARY%-%GITHUB_SHA%.zip"
569+
ren "%LIBRARY%-%GITHUB_SHA%" "%LIBRARY%"
570+
cd ..
555571
git submodule update --init tools/boostdep
556572
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
557573
cmd /c bootstrap
@@ -560,7 +576,7 @@ jobs:
560576
- name: Run tests
561577
shell: cmd
562578
run: |
563-
cd ../boost-root
579+
cd boost-root
564580
if "${{matrix.extra_tests}}" == "" set BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
565581
if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}}
566582
if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}}

0 commit comments

Comments
 (0)