Use depinst to install library dependencies in GHA config.

This commit is contained in:
Andrey Semashev 2022-09-21 19:19:38 +03:00
parent 00f4f11f14
commit 860eed6baf

View File

@ -383,6 +383,7 @@ jobs:
BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null)
echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV
echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV
DEPINST_ARGS=()
GIT_VERSION="$(git --version | sed -e 's/git version //')" GIT_VERSION="$(git --version | sed -e 's/git version //')"
GIT_HAS_JOBS=1 GIT_HAS_JOBS=1
if [ -f "/etc/debian_version" ] if [ -f "/etc/debian_version" ]
@ -409,25 +410,16 @@ jobs:
fi fi
if [ "$GIT_HAS_JOBS" -ne 0 ] if [ "$GIT_HAS_JOBS" -ne 0 ]
then then
GIT_ARGS="--jobs $GIT_FETCH_JOBS" DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
fi fi
cd .. cd ..
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
cd boost-root cd boost-root
mkdir -p libs/$LIBRARY mkdir -p libs/$LIBRARY
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule init tools/boost_install git submodule update --init tools/boostdep
git submodule init libs/headers DEPINST_ARGS+=("$LIBRARY")
git submodule init tools/build python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
git submodule init tools/cmake
git submodule init libs/assert
git submodule init libs/config
git submodule init libs/static_assert
git submodule init libs/throw_exception
git submodule init libs/type_traits
git submodule init libs/utility
git submodule init libs/io
git submodule update $GIT_ARGS
./bootstrap.sh ./bootstrap.sh
./b2 headers ./b2 headers
if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ]
@ -519,18 +511,8 @@ jobs:
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule init tools/boost_install git submodule update --init tools/boostdep
git submodule init libs/headers python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
git submodule init tools/build
git submodule init tools/cmake
git submodule init libs/assert
git submodule init libs/config
git submodule init libs/static_assert
git submodule init libs/throw_exception
git submodule init libs/type_traits
git submodule init libs/utility
git submodule init libs/io
git submodule update --jobs %GIT_FETCH_JOBS%
cmd /c bootstrap cmd /c bootstrap
b2 -d0 headers b2 -d0 headers
@ -569,14 +551,14 @@ jobs:
REF=${GITHUB_BASE_REF:-$GITHUB_REF} REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/} REF=${REF#refs/heads/}
echo REF: $REF echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH echo BOOST_BRANCH: $BOOST_BRANCH
cd .. cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
- name: Use library with add_subdirectory - name: Use library with add_subdirectory
run: | run: |
@ -615,17 +597,17 @@ jobs:
REF=${GITHUB_BASE_REF:-$GITHUB_REF} REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/} REF=${REF#refs/heads/}
echo REF: $REF echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH echo BOOST_BRANCH: $BOOST_BRANCH
cd .. cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
- name: Configure - name: Configure
run: | run:
cd ../boost-root cd ../boost-root
mkdir __build__ && cd __build__ mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local .. cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
@ -671,14 +653,14 @@ jobs:
REF=${GITHUB_BASE_REF:-$GITHUB_REF} REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/} REF=${REF#refs/heads/}
echo REF: $REF echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH echo BOOST_BRANCH: $BOOST_BRANCH
cd .. cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
- name: Configure - name: Configure
run: | run: |