Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ For specific operational instructions (session bootstrap, turn logging lifecycle
## Build, Test, Lint

```powershell
# Build
dotnet build src\McpServer.Support.Mcp -c Debug
dotnet build src\McpServer.Client -c Debug
# Build (via Nuke)
./build.ps1 Compile
# or: dotnet build src\McpServer.Support.Mcp -c Debug

# Run unit tests
dotnet test tests\McpServer.Support.Mcp.Tests -c Debug
dotnet test tests\McpServer.Client.Tests -c Debug
# Run all unit tests (via Nuke)
./build.ps1 Test
# or individual projects:
# dotnet test tests\McpServer.Support.Mcp.Tests -c Debug
# dotnet test tests\McpServer.Client.Tests -c Debug
# dotnet test tests\Build.Tests -c Debug

# Run integration tests (uses CustomWebApplicationFactory, in-memory EF)
dotnet test tests\McpServer.Support.Mcp.IntegrationTests -c Debug
Expand All @@ -40,8 +43,12 @@ dotnet test tests\McpServer.Support.Mcp.Tests -c Debug --filter "FullyQualifiedN
# Run tests in a single class
dotnet test tests\McpServer.Support.Mcp.Tests -c Debug --filter "FullyQualifiedName~TodoServiceTests"

# Validate appsettings config
pwsh.exe ./scripts/Validate-McpConfig.ps1
# Validate appsettings config (via Nuke)
./build.ps1 ValidateConfig
# or: pwsh.exe ./scripts/Validate-McpConfig.ps1

# Validate requirements traceability
./build.ps1 ValidateTraceability

# Markdown lint (docs only)
# CI uses markdownlint-cli2 with .markdownlint-cli2.yaml
Expand Down
163 changes: 163 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: Build and Test

on:
push:
branches: [main, develop]
paths:
- src/**
- tests/**
- build/**
- build.ps1
- build.sh
- '*.sln'
- Directory.Build.props
- Directory.Packages.props
- GitVersion.yml
- .github/workflows/build.yml
pull_request:
branches: [main, develop]
paths:
- src/**
- tests/**
- build/**
- build.ps1
- build.sh
- '*.sln'
- Directory.Build.props
- Directory.Packages.props
- GitVersion.yml
- .github/workflows/build.yml

jobs:
build-test:
name: Build & Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Compile
run: ./build.ps1 Compile --configuration Release
shell: pwsh

- name: Test
run: ./build.ps1 Test --configuration Release
shell: pwsh

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults/**/*.trx
if-no-files-found: ignore

validate:
name: Validate
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Validate Config
run: ./build.ps1 ValidateConfig
shell: pwsh

- name: Validate Traceability
run: ./build.ps1 ValidateTraceability
shell: pwsh

package:
name: Package
needs: build-test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Pack NuGet
run: ./build.ps1 PackNuGet --configuration Release
shell: pwsh

- name: Pack REPL Tool
run: ./build.ps1 PackReplTool --configuration Release
shell: pwsh

- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: artifacts/nupkg/*.nupkg

- name: Upload REPL tool package
uses: actions/upload-artifact@v4
with:
name: repl-tool-package
path: local-packages/*.nupkg

msix:
name: MSIX Package
needs: build-test
runs-on: windows-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Package MSIX
run: ./build.ps1 PackageMsix --configuration Release
shell: pwsh

- name: Upload MSIX artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: msix-package
path: artifacts/msix/*.msix

publish:
name: Publish
needs: build-test
if: github.event_name == 'push'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Publish Server
run: ./build.ps1 Publish --configuration Release
shell: pwsh

- name: Upload publish artifact
uses: actions/upload-artifact@v4
with:
name: mcp-server-publish
path: artifacts/mcp-server/
Loading
Loading