Fix build on latest c-ares (#331) #1
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: Build ubuntu-gcc | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
link: [ 'STATIC', 'SHARED' ] | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
build-type: ['Debug', 'Release'] | |
# TODO: ubuntu botan is v2, v2 support is removed | |
# tls-provider: ['', 'openssl', 'botan'] | |
tls-provider: ['', 'openssl'] | |
steps: | |
- name: Install dependencies | |
run: | | |
# Installing packages might fail as the github image becomes outdated | |
sudo apt update | |
sudo apt install libspdlog-dev libfmt-dev | |
- name: Install dependencies - OpenSSL | |
if: matrix.tls-provider == 'openssl' | |
run: | | |
sudo apt install openssl libssl-dev | |
- name: Install gtest | |
run: | | |
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz | |
tar xf v1.13.0.tar.gz | |
cd googletest-1.13.0 | |
cmake . | |
make -j && sudo make install | |
- name: Checkout Trantor source code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Create build directory | |
run: | | |
mkdir build | |
- name: Create Build Environment & Configure Cmake | |
shell: bash | |
working-directory: ./build | |
if: ${{matrix.link}} == "SHARED" | |
run: | | |
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF" | |
cmake .. \ | |
-DTRANTOR_USE_TLS=${{matrix.tls-provider}} \ | |
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \ | |
-DBUILD_SHARED_LIBS=$shared \ | |
-DCMAKE_INSTALL_PREFIX=../install \ | |
-DUSE_SPDLOG=ON \ | |
-DBUILD_TESTING=ON | |
- name: Build | |
shell: bash | |
working-directory: ./build | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: | | |
sudo make && sudo make install | |
- name: Test | |
working-directory: ./build | |
shell: bash | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: | | |
make test | |