[C#] feat: add unit tests for Teams SSO auth related classes (#1112) #554
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup .NET ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 | |
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@4d510cbed8a05af5aefea46c7fd6e05b95844c89 # 5.2.0 | |
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@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 | |
with: | |
name: testresults-dotnet-${{ matrix.dotnet-version }} | |
path: ${{ env.SOLUTION_DIR }}TestResults | |
- name: Harden Runner | |
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | |
with: | |
egress-policy: audit |