Skip to content

docs

docs #1084

#
# This workflow will build/test/lint the .NET SDK.
#
name: DOTNET Build/Test/Lint
on:
workflow_call:
workflow_dispatch:
push:
branches: ['**']
paths: ['.github/workflows/dotnet-*.yml', 'dotnet/**']
permissions: read-all
jobs:
build-test-lint:
name: Build/Test/Lint
runs-on: windows-latest
strategy:
matrix:
dotnet-version: ['6.0', '7.0']
fail-fast: false
defaults:
run:
shell: bash
working-directory: dotnet/packages/Microsoft.TeamsAI/
env:
SOLUTION_DIR: dotnet/packages/Microsoft.TeamsAI/
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore
run: dotnet restore Microsoft.Teams.AI.sln
- name: Build
run: dotnet build Microsoft.Teams.AI.sln --no-restore --configuration Release
- name: Test
run: dotnet test Microsoft.TeamsAI.Tests/Microsoft.Teams.AI.Tests.csproj --no-restore --verbosity normal --logger trx --results-directory ./TestResults --collect:"XPlat Code Coverage" --configuration Release
- name: Coverage
uses: danielpalme/ReportGenerator-GitHub-Action@e3af7259842d9c814021ea121f85526e0872b25f # 5.3.9
with:
reports: ${{ env.SOLUTION_DIR }}TestResults/*/coverage.cobertura.xml
targetdir: ${{ env.SOLUTION_DIR }}TestResults/coverage
reporttypes: 'HtmlInline;lcov'
toolpath: ${{ env.SOLUTION_DIR }}report-generator-tool
- name: Upload Tests
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: testresults-dotnet-${{ matrix.dotnet-version }}
path: ${{ env.SOLUTION_DIR }}TestResults
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit