Files
nt8-sdk/scripts/ci_build.sh
mo 78d4cdae35 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)
2026-07-13 09:31:54 -04:00

50 lines
1.6 KiB
Bash

#!/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 ==="