Skip to content

Commit

Permalink
Seperated Workflows.
Browse files Browse the repository at this point in the history
Removed CI.yml (Which had tests for Linux & Windows) and seperated them into their own workflows.
  • Loading branch information
ImLimiteds committed Sep 26, 2024
1 parent 32897ea commit fb794b5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml → .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: CI
name: Linux

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ubuntu-latest

steps:
- name: Checkout
Expand All @@ -23,4 +20,4 @@ jobs:
run: cmake --build build

- name: Run tests
run: ctest --test-dir build
run: ctest --test-dir build
23 changes: 23 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Windows

on: [push, pull_request]

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up CMake
uses: lukka/get-cmake@v3.30.3

- name: Configure CMake
run: cmake -B build

- name: Build
run: cmake --build build

- name: Run tests
run: ctest --test-dir build
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ on Windows 11 23H2**

Version: **1.0.0**

![CI](https://github.com/ImLimiteds/GabHTTP/actions/workflows/ci.yml/badge.svg)
![Linux](https://github.com/ImLimiteds/GabHTTP/actions/workflows/linux.yml/badge.svg)
![Windows](https://github.com/ImLimiteds/GabHTTP/actions/workflows/windows.yml/badge.svg)
4 changes: 3 additions & 1 deletion src/GabHttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <cstring>

#include <windows.h>


namespace GabHttp {
Request::Request(const std::string & raw_request) {
Expand Down Expand Up @@ -94,7 +96,7 @@ namespace GabHttp {
char client_ip[INET_ADDRSTRLEN];
inet_ntop(AF_INET, & client_addr.sin_addr, client_ip, INET_ADDRSTRLEN);

ssize_t bytes_read = recv(client_socket, buffer.data(), buffer.size() - 1, 0);
SSIZE_T bytes_read = recv(client_socket, buffer.data(), buffer.size() - 1, 0);
if (bytes_read <= 0) {
#ifdef _WIN32
closesocket(static_cast < SOCKET > (client_socket));
Expand Down

0 comments on commit fb794b5

Please sign in to comment.