Skip to content

Commit beb78ba

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 b91d551 commit beb78ba

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2023 Andrey Semashev
1+
# Copyright 2021-2024 Andrey Semashev
22
#
33
# Distributed under the Boost Software License, Version 1.0.
44
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
@@ -493,8 +493,6 @@ jobs:
493493
fi
494494
git config --global pack.threads 0
495495
496-
- uses: actions/checkout@v3
497-
498496
- name: Install packages
499497
if: matrix.install
500498
run: |
@@ -609,11 +607,25 @@ jobs:
609607
then
610608
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
611609
fi
610+
mkdir -p snapshot
611+
cd snapshot
612+
echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
613+
curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
614+
tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
615+
if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
616+
then
617+
echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
618+
ls -la
619+
exit 1
620+
fi
621+
rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
612622
cd ..
613623
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
614624
cd boost-root
615-
mkdir -p libs/$LIBRARY
616-
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
625+
[ -d libs ] || mkdir -p libs
626+
rm -rf "libs/$LIBRARY"
627+
mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
628+
rm -rf "../snapshot"
617629
git submodule update --init tools/boostdep
618630
DEPINST_ARGS+=("$LIBRARY")
619631
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
@@ -635,7 +647,7 @@ jobs:
635647
- name: Run tests
636648
if: matrix.cmake_tests == ''
637649
run: |
638-
cd ../boost-root
650+
cd boost-root
639651
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}")
640652
if [ -n "${{matrix.build_variant}}" ]
641653
then
@@ -690,7 +702,7 @@ jobs:
690702
then
691703
export MACOSX_DEPLOYMENT_TARGET="${{matrix.macosx_version_min}}"
692704
fi
693-
cd ../boost-root
705+
cd boost-root
694706
mkdir __build_static__ && cd __build_static__
695707
cmake ../libs/$LIBRARY/test/test_cmake
696708
cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS
@@ -740,8 +752,6 @@ jobs:
740752
runs-on: ${{matrix.os}}
741753

742754
steps:
743-
- uses: actions/checkout@v3
744-
745755
- name: Setup Boost
746756
run: |
747757
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
@@ -754,10 +764,24 @@ jobs:
754764
set BOOST_BRANCH=develop
755765
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
756766
echo BOOST_BRANCH: %BOOST_BRANCH%
767+
mkdir snapshot
768+
cd snapshot
769+
echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
770+
curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
771+
tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
772+
if not exist "%LIBRARY%-%GITHUB_SHA%\" (
773+
echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
774+
dir
775+
exit /b 1
776+
)
777+
del /f "%LIBRARY%-%GITHUB_SHA%.zip"
757778
cd ..
758779
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
759780
cd boost-root
760-
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
781+
if not exist "libs\" mkdir libs
782+
rmdir /s /q "libs\%LIBRARY%"
783+
move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
784+
rmdir /s /q "..\snapshot"
761785
git submodule update --init tools/boostdep
762786
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
763787
if "${{matrix.cmake_tests}}" == "" (
@@ -768,7 +792,7 @@ jobs:
768792
- name: Run tests
769793
if: matrix.cmake_tests == ''
770794
run: |
771-
cd ../boost-root
795+
cd boost-root
772796
set "B2_ARGS=-j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} embed-manifest-via=linker"
773797
if not "${{matrix.build_variant}}" == "" ( set "B2_ARGS=%B2_ARGS% variant=${{matrix.build_variant}}" ) else ( set "B2_ARGS=%B2_ARGS% variant=%DEFAULT_BUILD_VARIANT%" )
774798
if not "${{matrix.instruction_set}}" == "" ( set "B2_ARGS=%B2_ARGS% instruction-set=${{matrix.instruction_set}}" ) else ( set "B2_ARGS=%B2_ARGS% instruction-set=%DEFAULT_INSTRUCTION_SET%" )
@@ -792,7 +816,7 @@ jobs:
792816
- name: Run CMake tests
793817
if: matrix.cmake_tests
794818
run: |
795-
cd ../boost-root
819+
cd boost-root
796820
mkdir __build_static__
797821
cd __build_static__
798822
cmake ../libs/%LIBRARY%/test/test_cmake

0 commit comments

Comments
 (0)