Implemented generic mechanism for printing data of parsed binlog even… #116
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
BOOST_MAJOR: 1 | |
BOOST_MINOR: 83 | |
BOOST_PATCH: 0 | |
BOOST_EXT: .tar.bz2 | |
jobs: | |
formatting-check: | |
runs-on: ubuntu-22.04 | |
name: Formatting checks | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Check formatting with git diff --check | |
run: git diff --check --color HEAD~ | |
- name: Install dependencies on ubuntu | |
run: | | |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc | |
echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | sudo tee /etc/apt/sources.list.d/llvm.list | |
sudo apt-get update | |
sudo apt-get install clang-format-17 | |
- name: Info Clang Format | |
run: clang-format-17 --version | |
- name: Check formatting with git clang-format-17 | |
run: git clang-format-17 --diff --binary=clang-format-17 HEAD~ | |
build: | |
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | |
# You can convert this to a matrix build if you need cross-platform coverage. | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
name: ${{ matrix.config.name }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "GCC 13 Debug", | |
build_type: "Debug", | |
cc: "gcc-13", | |
cxx: "g++-13", | |
label: "debug_gcc13" | |
} | |
- { | |
name: "GCC 13 RelWithDebInfo", | |
build_type: "RelWithDebInfo", | |
cc: "gcc-13", | |
cxx: "g++-13", | |
label: "relwithdebinfo_gcc13" | |
} | |
- { | |
name: "Clang 17 Debug", | |
build_type: "Debug", | |
cc: "clang-17", | |
cxx: "clang++-17", | |
libcxx_cmake_flags: "-DWITH_STDLIB_LIBCXX=ON", | |
label: "debug_clang17" | |
} | |
- { | |
name: "Clang 17 RelWithDebInfo", | |
build_type: "RelWithDebInfo", | |
cc: "clang-17", | |
cxx: "clang++-17", | |
libcxx_cmake_flags: "-DWITH_STDLIB_LIBCXX=ON", | |
label: "relwithdebinfo_clang17" | |
} | |
steps: | |
- name: Info CPU | |
run: cat /proc/cpuinfo | |
- name: Info mount | |
run: mount | |
- name: Info df | |
run: df -h | |
- name: Install dependencies on ubuntu | |
if: startsWith(matrix.config.name, 'Clang') | |
run: | | |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc | |
echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | sudo tee /etc/apt/sources.list.d/llvm.list | |
sudo apt-get update | |
sudo apt-get install clang-17 lld-17 clang-tidy-17 libc++-17-dev libc++1-17 libc++abi-17-dev libc++abi1-17 | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install g++-13 | |
- name: Info CC compiler | |
run: ${{matrix.config.cc}} --version | |
- name: Info CXX compiler | |
run: ${{matrix.config.cxx}} --version | |
- name: Creating deps directory | |
run: mkdir -p ${{runner.temp}}/deps | |
- name: Cache boost tarball | |
id: cache-boost-tarball | |
uses: actions/cache@v3 | |
with: | |
path: ${{runner.temp}}/deps/${{format('boost_{0}_{1}_{2}{3}', env.BOOST_MAJOR, env.BOOST_MINOR, env.BOOST_PATCH, env.BOOST_EXT)}} | |
key: boost-tarball | |
- name: Download boost libraries | |
if: steps.cache-boost-tarball.outputs.cache-hit != 'true' | |
working-directory: ${{runner.temp}}/deps | |
run: wget --quiet ${{format('https://boostorg.jfrog.io/artifactory/main/release/{0}.{1}.{2}/source/boost_{0}_{1}_{2}{3}', env.BOOST_MAJOR, env.BOOST_MINOR, env.BOOST_PATCH, env.BOOST_EXT)}} | |
- name: Unpack boost libraries | |
working-directory: ${{runner.temp}}/deps | |
run: tar xf ${{format('boost_{0}_{1}_{2}{3}', env.BOOST_MAJOR, env.BOOST_MINOR, env.BOOST_PATCH, env.BOOST_EXT)}} | |
- uses: actions/checkout@v3 | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: | | |
cmake -Wdev -Werror=dev -Wdeprecated -Werror=deprecated \ | |
-B ${{github.workspace}}/../build-${{matrix.config.label}} \ | |
-DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} \ | |
-DCMAKE_C_COMPILER=${{matrix.config.cc}} \ | |
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} \ | |
${{matrix.config.libcxx_cmake_flags}} \ | |
-DBoost_ROOT=${{runner.temp}}/deps/${{format('boost_{0}_{1}_{2}', env.BOOST_MAJOR, env.BOOST_MINOR, env.BOOST_PATCH)}} \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
- name: CMake info | |
run: cmake -L ${{github.workspace}}/..//build-${{matrix.config.label}} | |
- name: Build | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/../build-${{matrix.config.label}} --config ${{matrix.config.build_type}} --parallel | |
- name: Info Clang Tidy | |
if: startsWith(matrix.config.name, 'Clang') | |
run: clang-tidy-17 --version | |
- name: Clang Tidy | |
if: startsWith(matrix.config.name, 'Clang') | |
# Run Clang Tidy | |
run: run-clang-tidy-17 -header-filter=.* -j=2 -use-color -p=${{github.workspace}}/../build-${{matrix.config.label}} | |
- name: Test | |
working-directory: ${{github.workspace}}/../build-${{matrix.config.label}} | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest -C ${{matrix.config.build_type}} --parallel |