Skip to content

tests: mine nginx, haproxy and h2o for the cases our own reviews missed #497

tests: mine nginx, haproxy and h2o for the cases our own reviews missed

tests: mine nginx, haproxy and h2o for the cases our own reviews missed #497

Workflow file for this run

name: Build and Publish
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
# pg + redis sidecars so the e2e suite's pg/redis tests run (they skip cleanly if absent).
services:
postgres:
image: postgres:18
env:
POSTGRES_USER: bench
POSTGRES_DB: bench
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '11.0.100-preview.5.26302.115'
- name: Restore
run: dotnet restore ioxide.slnx
- name: Build
run: dotnet build ioxide.slnx --configuration Release --no-restore
# kTLS module for the TLS e2e test; io_uring enable in case a runner disables it (both best-effort).
- name: Prepare runtime (kTLS + io_uring)
run: |
sudo modprobe tls 2>/dev/null || true
sudo sysctl -w kernel.io_uring_disabled=0 2>/dev/null || true
# Every suite, each its own project (see tests/README.md). Unit needs nothing; the rest
# drive real reactors over real sockets and skip cleanly when a sidecar is absent. Any
# non-zero exit fails the job before pack or publish.
- name: Run tests
env:
IOXIDE_PG_HOST: 127.0.0.1
IOXIDE_PG_PORT: 5432
IOXIDE_REDIS_HOST: 127.0.0.1
IOXIDE_REDIS_PORT: 6379
run: |
# ioxide rings (RingEntries=8192) pin memory and the suites start many reactors, so the
# default 8 MB RLIMIT_MEMLOCK is exhausted. Raise it before the run.
sudo prlimit --pid $$ --memlock=-1:-1 2>/dev/null || ulimit -l unlimited 2>/dev/null || true
echo "memlock: $(ulimit -Sl) KB"
for suite in Unit E2E Http Pg Redis Tls File Chaos; do
echo "::group::$suite"
dotnet run --project tests/Ioxide.Tests.$suite/Ioxide.Tests.$suite.csproj \
--configuration Release --no-build
echo "::endgroup::"
done
# Paths mirror the src/ grouping in ioxide.slnx (core, protocols/, clients/, serving/).
# Every project carrying a PackageId is packed. ioxide.httpclient is the whole client -
# h1, h2 and h3 - and project-references http2/ngtcp2/nghttp3, so those ship as its NuGet
# dependencies. ioxide.nghttp2 is packed too but nothing depends on it: it is a
# standalone server-side alternative now, not something the client pulls in.
- name: Pack ioxide
run: dotnet pack src/ioxide/ioxide.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.http3
run: dotnet pack src/protocols/ioxide.http3/ioxide.http3.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.nghttp3
run: dotnet pack src/protocols/ioxide.nghttp3/ioxide.nghttp3.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.nghttp2
run: dotnet pack src/protocols/ioxide.nghttp2/ioxide.nghttp2.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.http2
run: dotnet pack src/protocols/ioxide.http2/ioxide.http2.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.ngtcp2
run: dotnet pack src/protocols/ioxide.ngtcp2/ioxide.ngtcp2.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.httpclient
run: dotnet pack src/clients/ioxide.httpclient/ioxide.httpclient.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.file
run: dotnet pack src/clients/ioxide.file/ioxide.file.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.pg
run: dotnet pack src/clients/ioxide.pg/ioxide.pg.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.redis
run: dotnet pack src/clients/ioxide.redis/ioxide.redis.csproj --configuration Release --no-build --output ./artifacts
- name: Pack ioxide.Kestrel
run: dotnet pack src/serving/ioxide.Kestrel/ioxide.Kestrel.csproj --configuration Release --no-build --output ./artifacts
- name: Publish to NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY --skip-duplicate
- name: Publish to GitHub Packages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push ./artifacts/*.nupkg --source https://nuget.pkg.github.com/MDA2AV/index.json --api-key $GITHUB_TOKEN --skip-duplicate