Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7bdbe09
Rename CI pipeline for clarity
Kaliumhexacyanoferrat Oct 27, 2025
66960a2
Add GitHub Actions workflow for platform support verification
Kaliumhexacyanoferrat Oct 27, 2025
a6887f7
Nop
Kaliumhexacyanoferrat Oct 27, 2025
809961f
Change triggers for less builds?
Kaliumhexacyanoferrat Oct 27, 2025
669b249
Try to trigger
Kaliumhexacyanoferrat Oct 27, 2025
dc4fd0c
Next try
Kaliumhexacyanoferrat Oct 27, 2025
8d76a2d
I am just a slave of ChatGPT
Kaliumhexacyanoferrat Oct 27, 2025
2105a59
Final version ..
Kaliumhexacyanoferrat Oct 27, 2025
4e47fa3
Specify the solution
Kaliumhexacyanoferrat Oct 27, 2025
506e6c8
Remove feature branch trigger?
Kaliumhexacyanoferrat Oct 27, 2025
0a2f42c
Simplify build without runtime identifies
Kaliumhexacyanoferrat Oct 27, 2025
4ac75cb
Further improvements
Kaliumhexacyanoferrat Oct 27, 2025
e0d07c5
Wrong project (:
Kaliumhexacyanoferrat Oct 27, 2025
169a07c
Yet another try
Kaliumhexacyanoferrat Oct 27, 2025
b0cff9a
Remove some build errors?
Kaliumhexacyanoferrat Oct 27, 2025
3addd62
Shorten the check names
Kaliumhexacyanoferrat Oct 27, 2025
96e78c9
Align pipeline naming
Kaliumhexacyanoferrat Oct 27, 2025
dea560d
Revert target framework because this did not work
Kaliumhexacyanoferrat Oct 27, 2025
49e36e3
Use ARM64 natively
Kaliumhexacyanoferrat Oct 27, 2025
ea1ee73
sigh
Kaliumhexacyanoferrat Oct 27, 2025
48debbc
Ah, now I see the issue
Kaliumhexacyanoferrat Oct 27, 2025
5338504
Fully fixed version
Kaliumhexacyanoferrat Oct 27, 2025
37bb2a0
Use internal engine only
Kaliumhexacyanoferrat Oct 27, 2025
d8f8ff3
...
Kaliumhexacyanoferrat Oct 27, 2025
890da72
Disable Kestrel on verify
Kaliumhexacyanoferrat Oct 27, 2025
9e4547d
Disable arm32 for now
Kaliumhexacyanoferrat Oct 27, 2025
332be32
...
Kaliumhexacyanoferrat Oct 27, 2025
ec807a4
Remove ARM32 and fix ARM64 build on .NET 8
Kaliumhexacyanoferrat Oct 28, 2025
8ae0c66
Rename elements for more clarity
Kaliumhexacyanoferrat Oct 28, 2025
27259e3
Try with emojis
Kaliumhexacyanoferrat Oct 28, 2025
fc601aa
Even better
Kaliumhexacyanoferrat Oct 28, 2025
1d29a0f
Even betterer
Kaliumhexacyanoferrat Oct 28, 2025
9ae5a66
The bettest
Kaliumhexacyanoferrat Oct 28, 2025
94ae472
Consolidate into a single job
Kaliumhexacyanoferrat Oct 28, 2025
9c6191d
Now working?
Kaliumhexacyanoferrat Oct 28, 2025
5224e9d
Add more platforms
Kaliumhexacyanoferrat Oct 28, 2025
4502e6c
Try correct images
Kaliumhexacyanoferrat Oct 28, 2025
c6c4952
Try to run platform tests after CI build
Kaliumhexacyanoferrat Oct 28, 2025
499f04d
All in one?
Kaliumhexacyanoferrat Oct 28, 2025
b1c4092
Clarify readme regarding platform support
Kaliumhexacyanoferrat Oct 28, 2025
269e949
Adjust badge for the new workflow
Kaliumhexacyanoferrat Oct 28, 2025
cfd5dfb
Remove build badge because its not too useful
Kaliumhexacyanoferrat Oct 28, 2025
f3867f9
Put discord last again
Kaliumhexacyanoferrat Oct 28, 2025
28f6260
Rename to a human-readable name
Kaliumhexacyanoferrat Oct 28, 2025
f627f8d
Always use .NET 9 to allow usage of latest C# version in the future
Kaliumhexacyanoferrat Oct 28, 2025
60419de
Remove dependency to .NET within the matrix
Kaliumhexacyanoferrat Oct 28, 2025
e768a47
will this work?
Kaliumhexacyanoferrat Oct 28, 2025
fb6ff81
Add arm32 linux step
Kaliumhexacyanoferrat Oct 30, 2025
03dfb1d
Skip .NET setup on arm32
Kaliumhexacyanoferrat Oct 30, 2025
787f921
Put arm32 before arm64
Kaliumhexacyanoferrat Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Build

on:
pull_request:
branches: [ main ]

jobs:

build:

name: Test & Coverage

runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOTNET_ROLL_FORWARD: Major

steps:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install msquic
run: |
sudo apt-get update
sudo apt-get install -y libmsquic

- name: Download .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0

- name: Restore tools
run: dotnet tool restore

- name: Begin scan
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != ''
run: dotnet sonarscanner begin /k:"GenHTTP" /d:sonar.token="$SONAR_TOKEN" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*,**/Playground/**/*,**/*.css,**/*.js,**/*.html" /o:"kaliumhexacyanoferrat" /k:"GenHTTP" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.branch.name="${GITHUB_REF##*/}" /d:sonar.dotnet.excludeTestProjects=true

- name: Build project
run: dotnet build GenHTTP.slnx -c Release

- name: Test project
run: dotnet test GenHTTP.slnx --no-build --collect:"XPlat Code Coverage" -c Release -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover

- name: End scan
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != ''
run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN"

verify:

name: ${{ matrix.os.name }} ${{ matrix.arch }}

needs: build

runs-on: ${{ matrix.os.runs-on }}

env:
TEST_ENGINE: Internal

strategy:
fail-fast: false
matrix:
include:

- os:
name: 🐧
runs-on: ubuntu-latest
arch: x64
runtime: linux-x64
platform: linux/amd64

- os:
name: 🐧
runs-on: linux-arm32
arch: arm32
runtime: linux-arm
platform: linux/arm/v7

- os:
name: 🐧
runs-on: ubuntu-22.04-arm
arch: arm64
runtime: linux-arm64
platform: linux/arm64/v8

- os:
name: 🪟
runs-on: windows-latest
arch: x64
runtime: win-x64
platform: windows/amd64

- os:
name: 🪟
runs-on: windows-latest
arch: arm64
runtime: win-arm64
platform: windows/arm64

- os:
name: 🍎
runs-on: macos-15-intel
arch: x64
runtime: osx-x64
platform: macos/amd64

- os:
name: 🍎
runs-on: macos-15
arch: arm64
runtime: osx-arm64
platform: macos/arm64

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
if: matrix.os.runs-on != 'linux-arm32'
with:
dotnet-version: |
8.0
9.0

- name: Build & Test (${{ matrix.runtime }})
run: dotnet test Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj -c Release
50 changes: 0 additions & 50 deletions .github/workflows/ci.yml

This file was deleted.

20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GenHTTP is a lightweight web server written in pure C# with a strong focus on de
purpose of this project is to quickly create web services written in .NET 8 / 9, allowing developers to concentrate on
the functionality rather than on messing around with configuration files or complex concepts.

[![CI](https://github.com/Kaliumhexacyanoferrat/GenHTTP/actions/workflows/ci.yml/badge.svg)](https://github.com/Kaliumhexacyanoferrat/GenHTTP/actions/workflows/ci.yml) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GenHTTP&metric=coverage)](https://sonarcloud.io/dashboard?id=GenHTTP) [![nuget Package](https://img.shields.io/nuget/v/GenHTTP.Core.svg)](https://www.nuget.org/packages/GenHTTP.Core/) [](https://discord.gg/cW6tPJS7nt) [![Discord](https://discordapp.com/api/guilds/1177529388229734410/widget.png?style=shield)](https://discord.gg/GwtDyUpkpV)
[![View - Documentation](https://img.shields.io/badge/view-Documentation-AB54FF)](https://genhttp.org/documentation/) [![nuget Package](https://img.shields.io/nuget/v/GenHTTP.Core.svg)](https://www.nuget.org/packages/GenHTTP.Core/) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GenHTTP&metric=coverage)](https://sonarcloud.io/dashboard?id=GenHTTP) [![Discord](https://discordapp.com/api/guilds/1177529388229734410/widget.png?style=shield)](https://discord.gg/GwtDyUpkpV)

## 🚀 Features

Expand All @@ -16,6 +16,18 @@ the functionality rather than on messing around with configuration files or comp
- [Optimized](https://genhttp.org/features/) out of the box, small memory and storage [footprint](https://genhttp.org/features/#footprint)
- Grade A+ security level according to SSL Labs

## 💻 Supported Platforms

GenHTTP targets all .NET versions currently [supported by Microsoft](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core).
Major versions are released once a year, following the .NET release cycle.
Additionally, our automated tests ensure full compatibility on the following platforms:

| OS | Architectures |
|---------|-------------------------|
| Linux | `x64`, `arm32`, `arm64` |
| Windows | `x64`, `arm64` |
| macOS | `x64`, `arm64` |

## 📖 Getting Started

This section shows how to create a new project from scratch using project templates and how to extend your existing
Expand Down Expand Up @@ -123,9 +135,3 @@ in C#. In 2024 the focus has shifted towards API development, dropping support f

- Powered by [.NET](https://github.com/dotnet/core)
- Modules implemented with [NSwag](https://github.com/RicoSuter/NSwag) (Open API), [Fleck](https://github.com/statianzo/Fleck) (WebSockets)

## 👥 Contributors

<a href="https://github.com/Kaliumhexacyanoferrat/GenHTTP/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Kaliumhexacyanoferrat/GenHTTP" />
</a>
4 changes: 3 additions & 1 deletion Testing/Acceptance/Engine/Kestrel/CustomizingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
namespace GenHTTP.Testing.Acceptance.Engine.Kestrel;

[TestClass]
public class CustomizingTests
public class CustomizingTests : KestrelBaseTest
{

[TestMethod]
public async Task TestHooks()
{
if (!CheckKestrel()) return;

var configHook = (WebApplicationBuilder b) => { };

var appHook = (WebApplication a) => { };
Expand Down
8 changes: 8 additions & 0 deletions Testing/Acceptance/Engine/Kestrel/KestrelBaseTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace GenHTTP.Testing.Acceptance.Engine.Kestrel;

public class KestrelBaseTest
{

protected bool CheckKestrel() => Environment.GetEnvironmentVariable("TEST_ENGINE") == null;

}
4 changes: 3 additions & 1 deletion Testing/Acceptance/Engine/Kestrel/LifecycleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
namespace GenHTTP.Testing.Acceptance.Engine.Kestrel;

[TestClass]
public class LifecycleTests
public class LifecycleTests : KestrelBaseTest
{

[TestMethod]
public async Task TestLifecycle()
{
if (!CheckKestrel()) return;

var handler = Content.From(Resource.FromString("Hello Kestrel!")).Build();

await using var host = new TestHost(handler, engine: TestEngine.Kestrel);
Expand Down
8 changes: 7 additions & 1 deletion Testing/Acceptance/Engine/Kestrel/MappingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
namespace GenHTTP.Testing.Acceptance.Engine.Kestrel;

[TestClass]
public class MappingTests
public class MappingTests : KestrelBaseTest
{

[TestMethod]
public async Task TestHeaders()
{
if (!CheckKestrel()) return;

var app = Inline.Create().Get((IRequest request) =>
{
var count = request.Headers.Count;
Expand All @@ -37,6 +39,8 @@ public async Task TestHeaders()
[TestMethod]
public async Task TestQuery()
{
if (!CheckKestrel()) return;

var app = Inline.Create().Get((IRequest request) =>
{
var count = request.Query.Count;
Expand All @@ -63,6 +67,8 @@ public async Task TestQuery()
[TestMethod]
public async Task TestConnection()
{
if (!CheckKestrel()) return;

var app = Inline.Create().Get((IRequest request) =>
{
Assert.IsNotNull(request.Client.Host);
Expand Down
4 changes: 3 additions & 1 deletion Testing/Acceptance/Engine/Kestrel/ProtocolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
namespace GenHTTP.Testing.Acceptance.Engine.Kestrel;

[TestClass]
public class ProtocolTests
public class ProtocolTests : KestrelBaseTest
{

[TestMethod]
public async Task TestHttp2And3()
{
if (!CheckKestrel()) return;

var logic = Inline.Create().Get((IRequest request) => request.ProtocolType);

var client = GetClient();
Expand Down
22 changes: 18 additions & 4 deletions Testing/Acceptance/MultiEngineTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,25 @@ public class MultiEngineTestAttribute : Attribute, ITestDataSource

public IEnumerable<object[]> GetData(MethodInfo methodInfo)
{
return new List<object[]>
var engine = Environment.GetEnvironmentVariable("TEST_ENGINE");

if (engine == null) {
return new List<object[]>
{
new object[] { TestEngine.Internal },
new object[] { TestEngine.Kestrel }
};
}

if (Enum.TryParse(engine, out TestEngine found))
{
new object[] { TestEngine.Internal },
new object[] { TestEngine.Kestrel }
};
return new List<object[]>
{
new object[] { found }
};
}

throw new InvalidOperationException($"Engine '{engine}' is not supported");
}

public string GetDisplayName(MethodInfo methodInfo, object?[]? data)
Expand Down