Skip to content

Merge branch 'main' into lilyydu/tools #1030

Merge branch 'main' into lilyydu/tools

Merge branch 'main' into lilyydu/tools #1030

#
# 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@5808021ec4deecb0ab3da051d49b4ce65fcc20af # 5.3.8
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@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
with:
name: testresults-dotnet-${{ matrix.dotnet-version }}
path: ${{ env.SOLUTION_DIR }}TestResults
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit