Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split cmake file,botan3 support for macos, win, ubuntu, rockylinux #352

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
run: |
# Installing packages might fail as the github image becomes outdated
sudo apt update
sudo apt install dos2unix clang-format
pip install cmake-format
sudo apt install dos2unix clang-format cmake-format

- name: Lint
run: ./format.sh && git diff --exit-code
134 changes: 83 additions & 51 deletions .github/workflows/macos-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,99 @@ on:
workflow_dispatch:

jobs:
build:
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
build-opt-off:
name: "${{matrix.link}}-${{matrix.build-type}}-opt-off"
runs-on: macos-latest
env:
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
strategy:
fail-fast: false
matrix:
link: [ 'STATIC', 'SHARED' ]
link: ["STATIC", "SHARED"]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build-type: ['Debug', 'Release']
# Botan needs std::ranges but clang on macOS doesn't support it yet
#tls-provider: ['', 'openssl', 'botan']
tls-provider: ['', 'openssl']
build-type: ["Debug", "Release"]
# Support (none, openssl, botan-3, auto)
tls-provider: ["none"]

steps:
- name: Install dependencies
# botan v3
run: |
brew install botan spdlog
- name: Install dependencies
shell: bash
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
brew install googletest

- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Configure Cmake
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DFETCH_BUILD_MISSING_DEPS=OFF \
-DTRANTOR_USE_SPDLOG=OFF \
-DTRANTOR_USE_C-ARES=OFF \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-DBUILD_TESTING=ON

- 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 && sudo make install
- name: Build
working-directory: ./build
run: |
make -j3

- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Test
working-directory: ./build
run: |
make test

build-opt-on:
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}"
runs-on: macos-latest
env:
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
strategy:
fail-fast: false
matrix:
link: ["STATIC", "SHARED"]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build-type: ["Debug", "Release"]
# Botan needs std::ranges but clang on macOS doesn't support it yet
# Support (none, openssl, botan-3, auto)
tls-provider: ["openssl", "botan-3"]

steps:
- name: Install dependencies
shell: bash
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
brew install googletest spdlog botan

- name: Create build directory
run: |
mkdir build
- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Create Build Environment & Configure Cmake
shell: bash
working-directory: ./build
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: Configure Cmake
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DFETCH_BUILD_MISSING_DEPS=OFF \
-DTRANTOR_USE_SPDLOG=ON \
-DTRANTOR_USE_C-ARES=ON \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-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: Build
working-directory: ./build
run: |
make -j3

- 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
- name: Test
working-directory: ./build
run: |
make test
154 changes: 91 additions & 63 deletions .github/workflows/rockylinux-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,82 +7,110 @@ on:
workflow_dispatch:

jobs:
build:
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
build-opt-off:
name: "${{matrix.link}}-${{matrix.build-type}}-opt-off"
runs-on: ubuntu-latest
container:
env:
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
container:
image: rockylinux:9.3
options: --user root
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']
link: ["STATIC", "SHARED"]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.)
build-type: ["Debug", "Release"]
# Support (none, openssl, botan-3, auto)
tls-provider: ["none"]

steps:
- name: Install dependencies
run: |
dnf install gcc-c++ cmake git wget -y
- name: Install build dependencies
run: |
dnf install epel-release -y
dnf install git cmake gcc gcc-c++ gtest-devel -y

- name: Install dependencies - spdlog
run: |
git clone https://github.com/gabime/spdlog.git
cd spdlog && mkdir build && cd build
cmake .. && make -j
- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Install dependencies - OpenSSL
if: matrix.tls-provider == 'openssl'
run: |
dnf install openssl-devel -y

- 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 && make install
- name: Configure Cmake
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DFETCH_BUILD_MISSING_DEPS=OFF \
-DTRANTOR_USE_SPDLOG=OFF \
-DTRANTOR_USE_C-ARES=OFF \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-DBUILD_TESTING=ON

- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Build
working-directory: ./build
run: |
make -j4

- name: Create build directory
run: |
mkdir build
- name: Test
working-directory: ./build
run: |
make test

- 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
build-opt-on:
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}"
runs-on: ubuntu-latest
env:
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
container:
image: rockylinux:9.3
options: --user root
strategy:
fail-fast: false
matrix:
link: ["STATIC", "SHARED"]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.)
build-type: ["Debug", "Release"]
# Support (none, openssl, botan-3, auto), rockylinux dnf provide botan2
tls-provider: ["openssl", "botan-3"]

steps:
- name: Install build dependencies
run: |
dnf install epel-release -y
dnf install git cmake gcc gcc-c++ -y
dnf install gtest-devel spdlog-devel c-ares-devel openssl-devel -y

- uses: actions/cache@v4
id: rockylinux-cache
with:
path: |
/usr/local/Botan
key: rockylinux-${{matrix.build-type}}-${{matrix.tls-provider}}

- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Build
shell: bash
working-directory: ./build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
make && make install
- name: Configure Cmake
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DFETCH_BUILD_MISSING_DEPS=OFF \
-DTRANTOR_USE_SPDLOG=ON \
-DTRANTOR_USE_C-ARES=ON \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-DBUILD_TESTING=ON

- 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
- name: Build
working-directory: ./build
run: |
make -j4

- name: Test
working-directory: ./build
run: |
make test
Loading
Loading