Skip to content

Commit 304ccf5

Browse files
committed
Split cmake file, botan3 support for win, ubuntu, rockylinux
1 parent 65f2455 commit 304ccf5

26 files changed

+1649
-629
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ jobs:
2424
run: |
2525
# Installing packages might fail as the github image becomes outdated
2626
sudo apt update
27-
sudo apt install dos2unix clang-format
28-
pip install cmake-format
27+
sudo apt install dos2unix clang-format cmake-format
2928
3029
- name: Lint
3130
run: ./format.sh && git diff --exit-code

.github/workflows/macos-clang.yml

Lines changed: 83 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,99 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
11-
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
10+
build-opt-off:
11+
name: "${{matrix.link}}-${{matrix.build-type}}-opt-off"
1212
runs-on: macos-latest
13+
env:
14+
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
1315
strategy:
1416
fail-fast: false
1517
matrix:
16-
link: [ 'STATIC', 'SHARED' ]
18+
link: ["STATIC", "SHARED"]
1719
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
18-
build-type: ['Debug', 'Release']
19-
# Botan needs std::ranges but clang on macOS doesn't support it yet
20-
#tls-provider: ['', 'openssl', 'botan']
21-
tls-provider: ['', 'openssl']
20+
build-type: ["Debug", "Release"]
21+
# Support (none, openssl, botan-3, auto)
22+
tls-provider: ["none"]
2223

2324
steps:
24-
- name: Install dependencies
25-
# botan v3
26-
run: |
27-
brew install botan spdlog
25+
- name: Install dependencies
26+
shell: bash
27+
working-directory: ${{env.GITHUB_WORKSPACE}}
28+
run: |
29+
brew install googletest
30+
31+
- name: Checkout Trantor source code
32+
uses: actions/checkout@v4
33+
with:
34+
submodules: true
35+
fetch-depth: 0
36+
37+
- name: Configure Cmake
38+
run: |
39+
cmake -B build -S . \
40+
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
41+
-DBUILD_SHARED_LIBS=$shared \
42+
-DFETCH_BUILD_MISSING_DEPS=OFF \
43+
-DTRANTOR_USE_SPDLOG=OFF \
44+
-DTRANTOR_USE_C-ARES=OFF \
45+
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
46+
-DBUILD_TESTING=ON
2847
29-
- name: Install gtest
30-
run: |
31-
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz
32-
tar xf v1.13.0.tar.gz
33-
cd googletest-1.13.0
34-
cmake .
35-
make && sudo make install
48+
- name: Build
49+
working-directory: ./build
50+
run: |
51+
make -j3
3652
37-
- name: Checkout Trantor source code
38-
uses: actions/checkout@v4
39-
with:
40-
submodules: true
41-
fetch-depth: 0
53+
- name: Test
54+
working-directory: ./build
55+
run: |
56+
make test
57+
58+
build-opt-on:
59+
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}"
60+
runs-on: macos-latest
61+
env:
62+
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
link: ["STATIC", "SHARED"]
67+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
68+
build-type: ["Debug", "Release"]
69+
# Botan needs std::ranges but clang on macOS doesn't support it yet
70+
# Support (none, openssl, botan-3, auto)
71+
tls-provider: ["openssl"]
72+
73+
steps:
74+
- name: Install dependencies
75+
shell: bash
76+
working-directory: ${{env.GITHUB_WORKSPACE}}
77+
run: |
78+
brew install googletest spdlog botan
4279
43-
- name: Create build directory
44-
run: |
45-
mkdir build
80+
- name: Checkout Trantor source code
81+
uses: actions/checkout@v4
82+
with:
83+
submodules: true
84+
fetch-depth: 0
4685

47-
- name: Create Build Environment & Configure Cmake
48-
shell: bash
49-
working-directory: ./build
50-
run: |
51-
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
52-
cmake .. \
53-
-DTRANTOR_USE_TLS=${{matrix.tls-provider}} \
54-
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
55-
-DBUILD_SHARED_LIBS=$shared \
56-
-DCMAKE_INSTALL_PREFIX=../install \
57-
-DUSE_SPDLOG=ON \
58-
-DBUILD_TESTING=ON \
86+
- name: Configure Cmake
87+
run: |
88+
cmake -B build -S . \
89+
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
90+
-DBUILD_SHARED_LIBS=$shared \
91+
-DFETCH_BUILD_MISSING_DEPS=OFF \
92+
-DTRANTOR_USE_SPDLOG=ON \
93+
-DTRANTOR_USE_C-ARES=ON \
94+
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
95+
-DBUILD_TESTING=ON
5996
60-
- name: Build
61-
shell: bash
62-
working-directory: ./build
63-
# Execute the build. You can specify a specific target with "--target <NAME>"
64-
run: |
65-
sudo make && sudo make install
97+
- name: Build
98+
working-directory: ./build
99+
run: |
100+
make -j3
66101
67-
- name: Test
68-
working-directory: ./build
69-
shell: bash
70-
# Execute tests defined by the CMake configuration.
71-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
72-
run: |
73-
make test
102+
- name: Test
103+
working-directory: ./build
104+
run: |
105+
make test

.github/workflows/rockylinux-gcc.yml

Lines changed: 91 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,82 +7,110 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
11-
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
10+
build-opt-off:
11+
name: "${{matrix.link}}-${{matrix.build-type}}-opt-off"
1212
runs-on: ubuntu-latest
13-
container:
13+
env:
14+
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
15+
container:
1416
image: rockylinux:9.3
1517
options: --user root
1618
strategy:
1719
fail-fast: false
1820
matrix:
19-
link: [ 'STATIC', 'SHARED' ]
20-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
21-
build-type: ['Debug', 'Release']
22-
# TODO: ubuntu botan is v2, v2 support is removed
23-
# tls-provider: ['', 'openssl', 'botan']
24-
tls-provider: ['', 'openssl']
21+
link: ["STATIC", "SHARED"]
22+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.)
23+
build-type: ["Debug", "Release"]
24+
# Support (none, openssl, botan-3, auto)
25+
tls-provider: ["none"]
2526

2627
steps:
27-
- name: Install dependencies
28-
run: |
29-
dnf install gcc-c++ cmake git wget -y
28+
- name: Install build dependencies
29+
run: |
30+
dnf install epel-release -y
31+
dnf install git cmake gcc gcc-c++ gtest-devel -y
3032
31-
- name: Install dependencies - spdlog
32-
run: |
33-
git clone https://github.com/gabime/spdlog.git
34-
cd spdlog && mkdir build && cd build
35-
cmake .. && make -j
33+
- name: Checkout Trantor source code
34+
uses: actions/checkout@v4
35+
with:
36+
submodules: true
37+
fetch-depth: 0
3638

37-
- name: Install dependencies - OpenSSL
38-
if: matrix.tls-provider == 'openssl'
39-
run: |
40-
dnf install openssl-devel -y
41-
42-
- name: Install gtest
43-
run: |
44-
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz
45-
tar xf v1.13.0.tar.gz
46-
cd googletest-1.13.0
47-
cmake .
48-
make -j && make install
39+
- name: Configure Cmake
40+
run: |
41+
cmake -B build -S . \
42+
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
43+
-DBUILD_SHARED_LIBS=$shared \
44+
-DFETCH_BUILD_MISSING_DEPS=OFF \
45+
-DTRANTOR_USE_SPDLOG=OFF \
46+
-DTRANTOR_USE_C-ARES=OFF \
47+
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
48+
-DBUILD_TESTING=ON
4949
50-
- name: Checkout Trantor source code
51-
uses: actions/checkout@v4
52-
with:
53-
submodules: true
54-
fetch-depth: 0
50+
- name: Build
51+
working-directory: ./build
52+
run: |
53+
make -j4
5554
56-
- name: Create build directory
57-
run: |
58-
mkdir build
55+
- name: Test
56+
working-directory: ./build
57+
run: |
58+
make test
5959
60-
- name: Create Build Environment & Configure Cmake
61-
shell: bash
62-
working-directory: ./build
63-
if: ${{matrix.link}} == "SHARED"
64-
run: |
65-
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
66-
cmake .. \
67-
-DTRANTOR_USE_TLS=${{matrix.tls-provider}} \
68-
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
69-
-DBUILD_SHARED_LIBS=$shared \
70-
-DCMAKE_INSTALL_PREFIX=../install \
71-
-DUSE_SPDLOG=ON \
72-
-DBUILD_TESTING=ON
60+
build-opt-on:
61+
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}"
62+
runs-on: ubuntu-latest
63+
env:
64+
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
65+
container:
66+
image: rockylinux:9.3
67+
options: --user root
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
link: ["STATIC", "SHARED"]
72+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.)
73+
build-type: ["Debug", "Release"]
74+
# Support (none, openssl, botan-3, auto), rockylinux dnf provide botan2
75+
tls-provider: ["openssl", "botan-3"]
76+
77+
steps:
78+
- name: Install build dependencies
79+
run: |
80+
dnf install epel-release -y
81+
dnf install git cmake gcc gcc-c++ -y
82+
dnf install gtest-devel spdlog-devel c-ares-devel openssl-devel -y
83+
84+
- uses: actions/cache@v4
85+
id: rockylinux-cache
86+
with:
87+
path: |
88+
/usr/local/Botan
89+
key: rockylinux-${{matrix.build-type}}-${{matrix.tls-provider}}
90+
91+
- name: Checkout Trantor source code
92+
uses: actions/checkout@v4
93+
with:
94+
submodules: true
95+
fetch-depth: 0
7396

74-
- name: Build
75-
shell: bash
76-
working-directory: ./build
77-
# Execute the build. You can specify a specific target with "--target <NAME>"
78-
run: |
79-
make && make install
97+
- name: Configure Cmake
98+
run: |
99+
cmake -B build -S . \
100+
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
101+
-DBUILD_SHARED_LIBS=$shared \
102+
-DFETCH_BUILD_MISSING_DEPS=OFF \
103+
-DTRANTOR_USE_SPDLOG=ON \
104+
-DTRANTOR_USE_C-ARES=ON \
105+
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
106+
-DBUILD_TESTING=ON
80107
81-
- name: Test
82-
working-directory: ./build
83-
shell: bash
84-
# Execute tests defined by the CMake configuration.
85-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
86-
run: |
87-
make test
108+
- name: Build
109+
working-directory: ./build
110+
run: |
111+
make -j4
88112
113+
- name: Test
114+
working-directory: ./build
115+
run: |
116+
make test

0 commit comments

Comments
 (0)