Add builds with local dependencies to Github Actions

This commit is contained in:
Sebastian Messmer 2021-04-18 12:54:44 -07:00
parent f05c5cefa9
commit c6bd069516
4 changed files with 119 additions and 6 deletions

View File

@ -151,8 +151,8 @@ references:
echo Download boost
cd ~
wget -O boost.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
if [ $(sha512sum boost.tar.bz2 | awk '{print $1;}') == "63bbd1743e7c904b2e69fdc2eafd1c2a8a30fd70d960dcd366059d0100f000cb605d56cbd9397bb18421631f1c9552a772c434d0f0caddbe56302273f51fd1f6" ]; then
wget -O boost.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2/download
if [ $(sha512sum boost.tar.bz2 | awk '{print $1;}') == "d86f060245e98dca5c7f3f831c98ea9ccbfa8310f20830dd913d9d4c939fbe7cb94accd35f1128e7c4faf6c27adb6f4bb54e5477a6bde983dfc7aa33c4eed03a" ]; then
echo Correct sha512sum
else
echo Wrong sha512sum
@ -162,7 +162,7 @@ references:
echo Extracting boost
tar -xf boost.tar.bz2
rm boost.tar.bz2
cd boost_1_72_0
cd boost_1_75_0
echo Install boost
./bootstrap.sh --with-libraries=filesystem,system,thread,chrono,program_options

View File

@ -0,0 +1,76 @@
name: 'Install local dependencies'
description: 'Install local dependencies'
runs:
using: "composite"
steps:
- name: Install local dependencies
shell: bash
run: |
set -v
# TODO Cache these dependencies for faster runtime
export NUMCORES=`nproc` && if [ ! -n "$NUMCORES" ]; then export NUMCORES=`sysctl -n hw.ncpu`; fi
echo Using $NUMCORES cores
echo Download range-v3
cd ~
wget https://github.com/ericniebler/range-v3/archive/0.11.0.tar.gz -O range-v3-0.11.0.tar.gz
if [ $(sha512sum range-v3-0.11.0.tar.gz | awk '{print $1;}') == "9d6cdcbc1e50104206ba731c3bdc9aab3acfcf69cd83f0e0b4de18b88df2a9e73d64e55638421768d4433c542b6619f6e5af6b17cccd3090cf8b4d4efe9863e4" ]; then
echo Correct sha512sum
else
echo Wrong sha512sum
sha512sum range-v3-0.11.0.tar.gz
exit 1
fi
tar -xvf range-v3-0.11.0.tar.gz
cd range-v3-0.11.0/
echo Install range-v3
mkdir build
cd build
cmake .. -DRANGES_HAS_WERROR=off -DRANGE_V3_EXAMPLES=off -DRANGE_V3_TESTS=off
make -j$NUMCORES
sudo make install
cd ~
rm -rf range-v3-0.11.0
rm range-v3-0.11.0.tar.gz
echo Download spdlog
cd ~
wget https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz -O spdlog.tar.gz
if [ $(sha512sum spdlog.tar.gz | awk '{print $1;}') == "77cc9df0c40bbdbfe1f3e5818dccf121918bfceac28f2608f39e5bf944968b7e8e24a6fc29f01bc58a9bae41b8892d49cfb59c196935ec9868884320b50f130c" ]; then
echo Correct sha512sum
else
echo Wrong sha512sum
sha512sum spdlog.tar.gz
exit 1
fi
tar -xvf spdlog.tar.gz
rm spdlog.tar.gz
cd spdlog-1.8.5
echo Install spdlog
mkdir build
cd build
cmake ..
make -j$NUMCORES
sudo make install
echo Download boost
cd ~
wget -O boost.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2/download
if [ $(sha512sum boost.tar.bz2 | awk '{print $1;}') == "d86f060245e98dca5c7f3f831c98ea9ccbfa8310f20830dd913d9d4c939fbe7cb94accd35f1128e7c4faf6c27adb6f4bb54e5477a6bde983dfc7aa33c4eed03a" ]; then
echo Correct sha512sum
else
echo Wrong sha512sum
sha512sum boost.tar.bz2
exit 1
fi
echo Extracting boost
tar -xf boost.tar.bz2
rm boost.tar.bz2
cd boost_1_75_0
echo Install boost
./bootstrap.sh --with-libraries=filesystem,system,thread,chrono,program_options
sudo ./b2 link=shared cxxflags=-fPIC --prefix=/usr -d0 -j$NUMCORES install

View File

@ -10,6 +10,9 @@ inputs:
build_type:
description: "Which cmake build type to use (e.g. Release, Debug, RelWithDebInfo)"
required: true
cmake_flags:
description: "Extra flags to add to the cmake command"
required: true
runs:
using: "composite"
steps:
@ -34,7 +37,7 @@ runs:
set -v
mkdir build
cd build
cmake .. -GNinja -DCMAKE_CXX_COMPILER=${{inputs.cxx}} -DCMAKE_C_COMPILER=${{inputs.cc}} -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=${{inputs.build_type}} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
cmake .. -GNinja -DCMAKE_CXX_COMPILER=${{inputs.cxx}} -DCMAKE_C_COMPILER=${{inputs.cc}} -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=${{inputs.build_type}} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache ${{inputs.cmake_flags}}
- name: Run ninja
shell: bash
run: |

View File

@ -70,6 +70,31 @@ jobs:
- Debug
- Release
- RelWithDebInfo
cmake_flags:
- ""
install_dependencies_manually:
- false
include:
- name: Local dependencies
os: ubuntu-18.04
compiler:
cxx: clang++-11
cc: clang-11
apt_package: clang-11
build_type: RelWithDebInfo
cmake_flags: -DDEPENDENCY_CONFIG=../cmake-utils/DependenciesFromLocalSystem.cmake
install_dependencies_manually: true
- name: Local dependencies
os: ubuntu-20.04
compiler:
cxx: clang++-11
cc: clang-11
apt_package: clang-11
build_type: RelWithDebInfo
cmake_flags: -DDEPENDENCY_CONFIG=../cmake-utils/DependenciesFromLocalSystem.cmake
install_dependencies_manually: true
runs-on: ${{matrix.os}}
env:
# Setting conan cache dir to a location where our Github Cache Action can find it
@ -106,6 +131,9 @@ jobs:
fi
sudo apt-get update
sudo apt-get install ninja-build libcurl4-openssl-dev libfuse-dev ccache ${{matrix.compiler.apt_package}}
- name: Install local dependencies
if: ${{ matrix.install_dependencies_manually }}
uses: ./.github/workflows/actions/install_local_dependencies
- name: Find pip cache location
id: pip_cache_dir
run: |
@ -156,6 +184,11 @@ jobs:
ccache -p
echo Clearing ccache statistics
ccache -z
- name: Hash flags
id: hash_flags
run: |
echo "::set-output name=hash_flags::$(echo ${{matrix.cmake_flags}} | md5sum)"
shell: bash
- name: Retrieve ccache cache
# We're using an S3 based cache because the standard GitHub Action cache (actions/cache) only gives us 5GB of storage and we need more
uses: leroy-merlin-br/action-s3-cache@8d75079437b388688b9ea9c7d73dff4ef975c5fa # v1.0.5
@ -165,7 +198,7 @@ jobs:
aws-secret-access-key: ${{ secrets.CACHE_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.CACHE_AWS_REGION }}
bucket: ${{ secrets.CACHE_AWS_S3_BUCKET }}
key: v0-${{ runner.os }}-${{ matrix.os }}-ccache__${{matrix.compiler.cxx}}__${{matrix.compiler.cc}}__${{matrix.build_type}}__
key: v0-${{ runner.os }}-${{ matrix.os }}-ccache__${{matrix.compiler.cxx}}__${{matrix.compiler.cc}}__${{matrix.build_type}}__${{steps.hash_flags.outputs.hash_flags}}__
- name: Show ccache statistics
shell: bash
run: |
@ -196,6 +229,7 @@ jobs:
cxx: ${{ matrix.compiler.cxx }}
cc: ${{ matrix.compiler.cc }}
build_type: ${{ matrix.build_type }}
cmake_flags: ${{ matrix.cmake_flags }}
- name: Show ccache statistics
shell: bash
run: |
@ -216,7 +250,7 @@ jobs:
aws-secret-access-key: ${{ secrets.CACHE_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.CACHE_AWS_REGION }}
bucket: ${{ secrets.CACHE_AWS_S3_BUCKET }}
key: v0-${{ runner.os }}-${{ matrix.os }}-ccache__${{matrix.compiler.cxx}}__${{matrix.compiler.cc}}__${{matrix.build_type}}__
key: v0-${{ runner.os }}-${{ matrix.os }}-ccache__${{matrix.compiler.cxx}}__${{matrix.compiler.cc}}__${{matrix.build_type}}__${{steps.hash_flags.outputs.hash_flags}}__
artifacts: ${{ github.workspace }}/.ccache
- name: Save conan cache
uses: leroy-merlin-br/action-s3-cache@8d75079437b388688b9ea9c7d73dff4ef975c5fa # v1.0.5