Skip to content

Commit 83961e5

Browse files
Merge pull request #1 from alejandrofsevilla/addWorkflowsForMacOs
Add workflows for mac os
2 parents 1cfb783 + cacc9e1 commit 83961e5

File tree

4 files changed

+58
-3
lines changed

4 files changed

+58
-3
lines changed

.github/workflows/Linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux Build
1+
name: linux build
22

33
on: [push]
44

.github/workflows/MacOs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: macOs build
2+
3+
on: [push]
4+
5+
env:
6+
BUILD_TYPE: Release
7+
8+
jobs:
9+
build:
10+
runs-on: macOs-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: install dependencies
16+
run: brew update;
17+
brew install boost;
18+
brew install googletest
19+
20+
21+
- name: Configure CMake
22+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
23+
24+
- name: Build
25+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
26+
27+
- name: Test
28+
run: ${{github.workspace}}/build/tests/boost-tcp-server-client-tests
29+

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ![LinuxWorkflow](https://github.com/alejandrofsevilla/boost-tcp-server-client/actions/workflows/Linux.yml/badge.svg)
1+
# ![LinuxWorkflow](https://github.com/alejandrofsevilla/boost-tcp-server-client/actions/workflows/Linux.yml/badge.svg) ![MacOsWorkflow](https://github.com/alejandrofsevilla/boost-tcp-server-client/actions/workflows/MacOs.yml/badge.svg)
22
# Boost TCP Server/Client
33
Asynchronous [Boost.Asio](https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio.html) TCP Server and Client example.
44

@@ -69,3 +69,29 @@ auto address{boost::asio::ip::address::from_string("127.0.0.1")};
6969
client.connect({address, port});
7070
7171
```
72+
## How to build
73+
- Install dependencies.
74+
- linux
75+
```terminal
76+
sudo apt-get install libboost-dev
77+
sudo apt-get install libgtest-dev
78+
```
79+
- macOs
80+
```terminal
81+
brew install boost
82+
brew install googletest
83+
```
84+
- Clone repository.
85+
```terminal
86+
git clone https://github.com/alejandrofsevilla/boost-tcp-server-client.git
87+
cd boost-tcp-server-client
88+
```
89+
- Build.
90+
```terminal
91+
cmake -S . -B build
92+
cmake --build build
93+
```
94+
- Run tests.
95+
```terminal
96+
./build/tests/boost-tcp-server-client-tests
97+
```

tests/Test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace {
1111
inline std::string generateRandomString(size_t size) {
1212
std::random_device rd;
1313
std::mt19937 eng{rd()};
14-
std::uniform_int_distribution<char16_t> dist;
14+
std::uniform_int_distribution<int> dist;
1515
std::string str(size, {});
1616
std::generate(str.begin(), str.end(), std::bind(dist, eng));
1717
return str;

0 commit comments

Comments
 (0)