Skip to content

Commit

Permalink
🌊add build and test workflow
Browse files Browse the repository at this point in the history
🐛fixed some compile errors
  • Loading branch information
Lord-Turmoil committed Nov 26, 2024
1 parent fe44b13 commit 4afbc77
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Based on https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml

name: Build and Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j $(nproc)

test:
runs-on: ubuntu-latest
needs: build

steps:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
---

[![Build & Test](https://github.com/Lord-Turmoil/minet-core/actions/workflows/build-and-test.yml/badge.svg?branch=main)](https://github.com/Lord-Turmoil/minet-core/actions/workflows/build-and-test.yml)

# Prologue

**minet core** is a C++ HTTP server library that mimics the design of ASP.NET Core. It is designed to be a lightweight, high-performance, and easy-to-use library for building web applications in C++.
Expand Down
1 change: 1 addition & 0 deletions include/minet/common/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <unordered_map>
#include <vector>
#include <string>
#include "minet/common/Base.h"

MINET_BEGIN
Expand Down
1 change: 1 addition & 0 deletions include/minet/io/Stream.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <sys/types.h> // ssize_t
#include <vector>
#include "minet/common/Base.h"

Expand Down
1 change: 1 addition & 0 deletions include/minet/utils/Network.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <netinet/in.h>
#include <sys/types.h> // ssize_t
#include "minet/common/Base.h"

MINET_BEGIN
Expand Down
2 changes: 1 addition & 1 deletion src/common/Common.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <algorithm>

#include <cctype>
#include "minet/common/Log.h"

MINET_BEGIN
Expand Down

0 comments on commit 4afbc77

Please sign in to comment.