CI/CD Workflows
The repository uses multiple GitHub Actions workflows. What runs and when:
1) Build Solution (.github/workflows/build.yml)
- Triggers: push and pull_request to
v2_release, v2_develop (ignores **.md); supports workflow_call
- Runner/timeout:
ubuntu-latest, 10 minutes
- Steps:
- Checkout and setup .NET 8.x GA
dotnet restore
- Build Debug:
dotnet build --configuration Debug --no-restore -property:NoWarn=0618%3B0612
- Build Release (library):
dotnet build Terminal.Gui/Terminal.Gui.csproj --configuration Release --no-incremental --force -property:NoWarn=0618%3B0612
- Pack Release:
dotnet pack Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ./local_packages -property:NoWarn=0618%3B0612
- Restore NativeAot/SelfContained examples, then restore solution again
- Build Release for
Examples/NativeAot and Examples/SelfContained
- Build Release solution
- Upload artifacts named
build-artifacts, retention 1 day
2) Build & Run Unit Tests (.github/workflows/unit-tests.yml)
- Triggers: push and pull_request to
v2_release, v2_develop (ignores **.md)
- Matrix: Ubuntu/Windows/macOS
- Timeout: 15 minutes per job
- Process:
- Calls build workflow to build solution once
- Downloads build artifacts
- Runs
dotnet restore (required for --no-build to work)
- Performance optimizations:
- Disables Windows Defender on Windows runners (significant speedup)
- Collects code coverage only on Linux (ubuntu-latest) for performance
- Windows and macOS skip coverage collection to reduce test time
- Increased blame-hang-timeout to 120s for Windows/macOS (60s for Linux)
- Runs two test jobs:
- Non-parallel UnitTests:
Tests/UnitTests with blame/diag flags; xunit.stopOnFail=false
- Parallel UnitTestsParallelizable:
Tests/UnitTestsParallelizable with blame/diag flags; xunit.stopOnFail=false
- Uploads test logs and diagnostic data from all runners
- Uploads code coverage to Codecov only from Linux runner
Test results: All tests output to unified TestResults/ directory at repository root
3) Build & Run Integration Tests (.github/workflows/integration-tests.yml)
- Triggers: push and pull_request to
v2_release, v2_develop (ignores **.md)
- Matrix: Ubuntu/Windows/macOS
- Timeout: 15 minutes
- Process:
- Calls build workflow
- Downloads build artifacts
- Runs
dotnet restore
- Performance optimizations (same as unit tests):
- Disables Windows Defender on Windows runners
- Collects code coverage only on Linux
- Increased blame-hang-timeout to 120s for Windows/macOS
- Runs IntegrationTests with blame/diag flags;
xunit.stopOnFail=true
- Uploads logs per-OS
- Uploads coverage to Codecov only from Linux runner
4) Publish to NuGet (.github/workflows/publish.yml)
- Triggers: push to
v2_release, v2_develop, and tags v*(ignores **.md)
- Uses GitVersion to compute SemVer, builds Release, packs with symbols, and pushes to NuGet.org using
NUGET_API_KEY
5) Build and publish API docs (.github/workflows/api-docs.yml)
- Triggers: push to
v1_release and v2_develop
- Builds DocFX site on Windows and deploys to GitHub Pages when
ref_name is v2_release or v2_develop
Replicating CI Locally
# Full CI sequence:
dotnet restore
dotnet build --configuration Debug --no-restore
dotnet test Tests/UnitTests --no-build --verbosity normal
dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal
dotnet build --configuration Release --no-restore