Skip to content

Commit 4035096

Browse files
committed
Merge branch 'main' into inmemory_transport
2 parents 354e56f + aafa9d9 commit 4035096

27 files changed

+654
-194
lines changed

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"docfx": {
6+
"version": "2.78.3",
7+
"commands": [
8+
"docfx"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ jobs:
1515
matrix:
1616
os: [ubuntu-latest, windows-latest, macos-latest]
1717
configuration: [Debug, Release]
18+
fail-fast: false
1819

1920
steps:
2021
- uses: actions/checkout@v4
2122
with:
2223
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2324

2425
- name: Setup .NET
25-
uses: actions/setup-dotnet@v2
26+
uses: actions/setup-dotnet@v4
2627
with:
2728
dotnet-version: |
2829
9.0.x
@@ -48,4 +49,29 @@ jobs:
4849
run: dotnet build --configuration ${{ matrix.configuration }}
4950

5051
- name: Test
51-
run: dotnet test --filter '(Execution!=Manual)' --no-build --configuration ${{ matrix.configuration }}
52+
run: >-
53+
dotnet test
54+
--filter '(Execution!=Manual)'
55+
--no-build
56+
--configuration ${{ matrix.configuration }}
57+
--logger "console;verbosity=normal"
58+
--logger "trx"
59+
--logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
60+
--blame
61+
--blame-hang-timeout 7m
62+
--blame-crash
63+
--results-directory testresults
64+
--collect "XPlat Code Coverage" -- RunConfiguration.CollectSourceInformation=true
65+
66+
- name: Upload test results artifact
67+
if: always()
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: testresults-${{ matrix.os }}-${{ matrix.configuration }}
71+
path: testresults/**
72+
73+
publish-coverage:
74+
if: github.actor != 'dependabot[bot]'
75+
needs: build
76+
uses: ./.github/workflows/code-coverage.yml
77+
secrets: inherit
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Code Coverage
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
publish-coverage:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Setup .NET
12+
uses: actions/setup-dotnet@v4
13+
with:
14+
dotnet-version: |
15+
9.0.x
16+
8.0.x
17+
18+
- name: Download test results
19+
uses: actions/download-artifact@v4
20+
with:
21+
pattern: testresults-*
22+
23+
- name: Combine coverage reports
24+
uses: danielpalme/[email protected]
25+
with:
26+
reports: "**/*.cobertura.xml"
27+
targetdir: "${{ github.workspace }}/report"
28+
reporttypes: "HtmlSummary;Cobertura;MarkdownSummary;MarkdownSummaryGithub"
29+
verbosity: "Info"
30+
title: "Code Coverage"
31+
tag: "${{ github.run_number }}_${{ github.run_id }}"
32+
customSettings: ""
33+
toolpath: "reportgeneratortool"
34+
35+
- name: Upload combined coverage XML
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: coverage
39+
path: ${{ github.workspace }}/report
40+
retention-days: 7
41+
42+
- name: Publish code coverage report
43+
uses: irongut/[email protected]
44+
with:
45+
filename: "report/Cobertura.xml"
46+
badge: true
47+
fail_below_min: true
48+
format: markdown
49+
hide_branch_rate: false
50+
hide_complexity: false
51+
indicators: true
52+
output: both
53+
thresholds: "60 80"
54+
55+
- name: Upload combined coverage markdown
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: coverage-markdown
59+
path: ${{ github.workspace }}/code-coverage-results.md
60+
retention-days: 7
61+
62+
- name: Add Coverage PR Comment
63+
uses: marocchino/sticky-pull-request-comment@v2
64+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
65+
with:
66+
recreate: true
67+
path: ${{ github.workspace }}/code-coverage-results.md
68+
69+
- name: Coverage on step summary
70+
if: always()
71+
run: cat "${{ github.workspace }}/report/SummaryGithub.md" >> $GITHUB_STEP_SUMMARY

.github/workflows/docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Docs
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
actions: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
publish-docs:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
30+
- name: .NET Setup
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: 9.x
34+
35+
- name: Generate documentation
36+
run: make generate-docs
37+
38+
- name: Upload Pages artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: 'artifacts/_site'
42+
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ nCrunchTemp_*
8181
.NCrunch_ModelContextProtocol/
8282

8383
*.ncrunchproject
84+
85+
# Auto-generated documentation
86+
docs/_site
87+
docs/api

Directory.Packages.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
</PropertyGroup>
99
<ItemGroup>
1010
<!-- Product dependencies -->
11+
<PackageVersion Include="coverlet.collector" Version="6.0.4">
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
<PrivateAssets>all</PrivateAssets>
14+
</PackageVersion>
1115
<PackageVersion Include="Microsoft.Bcl.Memory" Version="$(SystemVersion)" />
1216
<PackageVersion Include="Microsoft.Extensions.AI" Version="$(MicrosoftExtensionsAIVersion)" />
1317
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="$(MicrosoftExtensionsAIVersion)" />
@@ -21,6 +25,7 @@
2125
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
2226
<!-- Testing dependencies -->
2327
<PackageVersion Include="Anthropic.SDK" Version="4.7.1" />
28+
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
2429
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="$(MicrosoftExtensionsAIVersion)" />
2530
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(MicrosoftExtensionsVersion)" />
2631
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsVersion)" />

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
SOURCE_DIRECTORY := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
2+
ARTIFACT_PATH := $(SOURCE_DIRECTORY)artifacts
3+
DOCS_PATH := $(SOURCE_DIRECTORY)docs
4+
CONFIGURATION ?= Release
5+
6+
clean:
7+
dotnet clean
8+
rm -rf $(ARTIFACT_PATH)/*
9+
rm -rf $(DOCS_PATH)/api
10+
11+
restore:
12+
dotnet tool restore
13+
dotnet restore
14+
15+
build: restore
16+
dotnet build --no-restore --configuration $(CONFIGURATION)
17+
18+
test: build
19+
dotnet test \
20+
--no-build \
21+
--configuration $(CONFIGURATION) \
22+
--filter '(Execution!=Manual)' \
23+
--blame \
24+
--diag "$(ARTIFACT_PATH)/diag.txt" \
25+
--logger "trx" \
26+
--collect "Code Coverage;Format=cobertura" \
27+
--results-directory $(ARTIFACT_PATH)/test-results \
28+
-- \
29+
RunConfiguration.CollectSourceInformation=true
30+
31+
generate-docs: clean restore
32+
dotnet build --no-restore --configuration Release
33+
dotnet docfx $(DOCS_PATH)/docfx.json
34+
35+
serve-docs: generate-docs
36+
dotnet docfx serve $(ARTIFACT_PATH)/_site --port 8080
37+
38+
.DEFAULT_GOAL := build

0 commit comments

Comments
 (0)