GAP-011: Gitea CI Pipeline

- Added .gitea/workflows/ci.yml with Windows and Linux (mono) build jobs
- Added scripts/ci_build.sh for Linux/mono runners
- Updated README.md with Gitea CI status badge
- Both workflows run verify-build.bat equivalent logic

Verification: ./verify-build.bat ✅ (492 tests passing)
This commit is contained in:
2026-07-13 09:31:54 -04:00
parent c9041df36a
commit 78d4cdae35
3 changed files with 122 additions and 0 deletions

71
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,71 @@
name: CI Build & Test
on:
push:
branches: [main, cleanup/wrappers-pass2]
pull_request:
branches: [main]
jobs:
build-and-test:
name: Build & Test (Windows)
runs-on: [self-hosted, windows]
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET Framework
uses: actions/setup-dotnet@v4
with:
dotnet-version: '4.8.x'
- name: Restore dependencies
run: dotnet restore NT8-SDK.sln
- name: Build solution
run: dotnet build NT8-SDK.sln --configuration Release --no-restore
- name: Run tests
run: dotnet test NT8-SDK.sln --configuration Release --no-build --logger trx
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: '**/*.trx'
- name: Upload build logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs
path: '**/*.log'
build-and-test-linux:
name: Build & Test (Linux/mono)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install mono
run: |
sudo apt-get update
sudo apt-get install -y mono-complete nuget
- name: Restore dependencies
run: nuget restore NT8-SDK.sln
- name: Build with mono
run: msbuild NT8-SDK.sln /p:Configuration=Release /p:TargetFrameworkVersion=v4.8
- name: Run tests with mono
run: |
mono packages/NUnit.ConsoleRunner.3.16.3/tools/nunit3-console.exe tests/NT8.Core.Tests/bin/Release/net48/NT8.Core.Tests.dll
mono packages/NUnit.ConsoleRunner.3.16.3/tools/nunit3-console.exe tests/NT8.Integration.Tests/bin/Release/net48/NT8.Integration.Tests.dll
mono packages/NUnit.ConsoleRunner.3.16.3/tools/nunit3-console.exe tests/NT8.Performance.Tests/bin/Release/net48/NT8.Performance.Tests.dll

View File

@@ -19,6 +19,7 @@ Quick reference docs in repo root:
**Status:** Phase 2 Complete
**Framework:** .NET Framework 4.8 / C# 5.0
**Platform:** NinjaTrader 8
**CI:** ![Gitea CI](https://gitea.com/your-org/nt8-sdk/actions/workflows/ci.yml/badge.svg)
---

50
scripts/ci_build.sh Normal file
View File

@@ -0,0 +1,50 @@
#!/bin/bash
# CI build wrapper for Linux runners (mono/.NET Framework via mono)
# This calls verify-build.bat logic adapted for Linux/mono
set -e
echo "=== NT8 SDK Linux CI Build ==="
# Check for mono
if ! command -v mono &> /dev/null; then
echo "Installing mono..."
sudo apt-get update && sudo apt-get install -y mono-complete nuget
fi
# Check for msbuild
if ! command -v msbuild &> /dev/null; then
echo "msbuild not found in PATH, trying /usr/lib/mono/msbuild/Current/bin/msbuild"
export PATH="/usr/lib/mono/msbuild/Current/bin:$PATH"
fi
echo "Restoring NuGet packages..."
nuget restore NT8-SDK.sln
echo "Building solution..."
msbuild NT8-SDK.sln /p:Configuration=Release /p:TargetFrameworkVersion=v4.8 /verbosity:minimal
echo "Running tests..."
# Find nunit console runner
NUNIT_CONSOLE=$(find packages -name "nunit3-console.exe" | head -1)
if [ -z "$NUNIT_CONSOLE" ]; then
echo "NUnit console runner not found, installing..."
nuget install NUnit.ConsoleRunner -Version 3.16.3 -OutputDirectory packages
NUNIT_CONSOLE=$(find packages -name "nunit3-console.exe" | head -1)
fi
echo "Using NUnit console: $NUNIT_CONSOLE"
# Run each test assembly
for test_dll in tests/NT8.Core.Tests/bin/Release/net48/NT8.Core.Tests.dll \
tests/NT8.Integration.Tests/bin/Release/net48/NT8.Integration.Tests.dll \
tests/NT8.Performance.Tests/bin/Release/net48/NT8.Performance.Tests.dll; do
if [ -f "$test_dll" ]; then
echo "Running tests in $test_dll"
mono "$NUNIT_CONSOLE" "$test_dll" --result=TestResult.xml
else
echo "Warning: $test_dll not found"
fi
done
echo "=== CI Build Complete ==="