| set -euo pipefail | |
| echo "π¨ Building C# project" | |
| echo "========================" | |
| # Check .NET SDK | |
| if ! command -v dotnet &> /dev/null; then | |
| echo "β .NET SDK not found. Install from https://dotnet.microsoft.com/download" | |
| exit 1 | |
| fi | |
| DOTNET_VERSION=$(dotnet --version) | |
| echo "β .NET SDK $DOTNET_VERSION" | |
| # Restore dependencies | |
| echo "" | |
| echo "π¦ Restoring packages..." | |
| dotnet restore | |
| # Build | |
| echo "" | |
| echo "π¨ Building..." | |
| dotnet build --no-restore --configuration Release | |
| # Run tests | |
| echo "" | |
| echo "π§ͺ Running tests..." | |
| dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" | |
| echo "" | |
| echo "β Build and tests complete!" | |
| echo " Release binary: bin/Release/net8.0/" | |
| echo " Coverage report: TestResults/*/coverage.cobertura.xml" | |