|
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | 9 | 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" |
12 | 12 | runs-on: ubuntu-latest |
13 | | - container: |
| 13 | + env: |
| 14 | + shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}} |
| 15 | + container: |
14 | 16 | image: rockylinux:9.3 |
15 | 17 | options: --user root |
16 | 18 | strategy: |
17 | 19 | fail-fast: false |
18 | 20 | 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"] |
25 | 26 |
|
26 | 27 | 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 |
30 | 32 |
|
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 |
36 | 38 |
|
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 |
49 | 49 |
|
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 |
55 | 54 |
|
56 | | - - name: Create build directory |
57 | | - run: | |
58 | | - mkdir build |
| 55 | + - name: Test |
| 56 | + working-directory: ./build |
| 57 | + run: | |
| 58 | + make test |
59 | 59 |
|
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 |
73 | 96 |
|
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 |
80 | 107 |
|
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 |
88 | 112 |
|
| 113 | + - name: Test |
| 114 | + working-directory: ./build |
| 115 | + run: | |
| 116 | + make test |
0 commit comments