Skip to content

Commit 00b79ae

Browse files
authored
Add build badge for individual OS (#307)
1 parent 89bf809 commit 00b79ae

File tree

9 files changed

+342
-206
lines changed

9 files changed

+342
-206
lines changed

.appveyor.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/cmake.yml

Lines changed: 0 additions & 141 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint source code
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
unix:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
16+
steps:
17+
- name: Checkout Trantor source code
18+
uses: actions/checkout@v2
19+
with:
20+
submodules: true
21+
fetch-depth: 0
22+
23+
- name: (Linux) Install dependencies
24+
run: |
25+
# Installing packages might fail as the github image becomes outdated
26+
sudo apt update
27+
sudo apt install dos2unix clang-format
28+
29+
- name: Lint
30+
if: matrix.os == 'ubuntu-20.04'
31+
working-directory: ${{env.GITHUB_WORKSPACE}}
32+
shell: bash
33+
run: ./format.sh && git diff --exit-code

.github/workflows/macos-clang.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build macos-clang
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
12+
runs-on: macos-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
link: [ 'STATIC', 'SHARED' ]
17+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
18+
build-type: ['Debug', 'Release']
19+
tls-provider: ['', 'openssl', 'botan']
20+
21+
steps:
22+
- name: Install dependencies
23+
# botan v3
24+
run: |
25+
brew install botan spdlog
26+
27+
- name: Install gtest
28+
run: |
29+
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz
30+
tar xf v1.13.0.tar.gz
31+
cd googletest-1.13.0
32+
cmake .
33+
make && sudo make install
34+
35+
- name: Checkout Trantor source code
36+
uses: actions/checkout@v4
37+
with:
38+
submodules: true
39+
fetch-depth: 0
40+
41+
- name: Create build directory
42+
run: |
43+
mkdir build
44+
45+
- name: Create Build Environment & Configure Cmake
46+
shell: bash
47+
working-directory: ./build
48+
run: |
49+
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
50+
cmake .. \
51+
-DTRANTOR_USE_TLS=${{matrix.tls-provider}} \
52+
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
53+
-DBUILD_SHARED_LIBS=$shared \
54+
-DCMAKE_INSTALL_PREFIX=../install \
55+
-DUSE_SPDLOG=ON \
56+
-DBUILD_TESTING=ON \
57+
58+
- name: Build
59+
shell: bash
60+
working-directory: ./build
61+
# Execute the build. You can specify a specific target with "--target <NAME>"
62+
run: |
63+
sudo make && sudo make install
64+
65+
- name: Test
66+
working-directory: ./build
67+
shell: bash
68+
# Execute tests defined by the CMake configuration.
69+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
70+
run: |
71+
make test

.github/workflows/rockylinux-gcc.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build rockylinux-gcc
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
12+
runs-on: ubuntu-latest
13+
container:
14+
image: rockylinux:9.3
15+
options: --user root
16+
strategy:
17+
fail-fast: false
18+
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']
25+
26+
steps:
27+
- name: Install dependencies
28+
run: |
29+
dnf install gcc-c++ cmake git wget -y
30+
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
36+
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
49+
50+
- name: Checkout Trantor source code
51+
uses: actions/checkout@v4
52+
with:
53+
submodules: true
54+
fetch-depth: 0
55+
56+
- name: Create build directory
57+
run: |
58+
mkdir build
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
73+
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
80+
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
88+

0 commit comments

Comments
 (0)