-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For #210 - Workflow *dotnet-ci* on push - build/test/pack and upload artifacts. - Workflow *dotnet-pr* on pull request - build/test and print test coverage. - Add `.editorconfig` file for lint and format. Use warning severity for now and will change to error after fixing all source code. Since GitHub detects workflows from the default branch. Actions will be available after #223 is merged. I used my forked repo to test the workflow. See https://github.com/swatDong/teams-ai/actions/runs/5441987419, https://github.com/swatDong/teams-ai/actions/runs/5442299363
- Loading branch information
Showing
4 changed files
with
477 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# | ||
# This workflow will build, run tests, and pack for the Microsoft.Bot.Builder.M365 .NET SDK. | ||
# | ||
|
||
name: dotnet-ci | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- DOTNET | ||
paths: | ||
- 'dotnet/packages/**' | ||
|
||
jobs: | ||
dotnet-build-test-pack: | ||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
dotnet-version: ['6.0', '7.0'] | ||
configuration: [Release] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
SOLUTION_DIR: dotnet/packages/Microsoft.Bot.Builder.M365/ | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
with: | ||
clean: true | ||
|
||
- name: Setup .NET SDK ${{ matrix.dotnet-version }} | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
- name: Restore | ||
shell: bash | ||
working-directory: ${{ env.SOLUTION_DIR }} | ||
run: dotnet restore Microsoft.Bot.Builder.M365.sln | ||
|
||
- name: Build | ||
shell: bash | ||
working-directory: ${{ env.SOLUTION_DIR }} | ||
run: dotnet build Microsoft.Bot.Builder.M365.sln --no-restore --configuration ${{ matrix.configuration }} | ||
|
||
- name: Test | ||
shell: bash | ||
working-directory: ${{ env.SOLUTION_DIR }} | ||
run: dotnet test Microsoft.Bot.Builder.M365.Tests/Microsoft.Bot.Builder.M365.Tests.csproj --no-restore --verbosity normal --logger trx --results-directory ./TestResults --collect:"XPlat Code Coverage" --configuration ${{ matrix.configuration }} | ||
|
||
- name: Pack | ||
shell: bash | ||
working-directory: ${{ env.SOLUTION_DIR }} | ||
run: dotnet pack --no-build --output . --configuration ${{ matrix.configuration }} Microsoft.Bot.Builder.M365/Microsoft.Bot.Builder.M365.csproj | ||
|
||
- name: Upload package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nupkg-dotnet-${{ matrix.dotnet-version }} | ||
path: ${{ env.SOLUTION_DIR }}*.nupkg | ||
|
||
- name: Generate coverage report | ||
uses: danielpalme/ReportGenerator-GitHub-Action@5.1.22 | ||
with: | ||
reports: ${{ env.SOLUTION_DIR }}TestResults/*/coverage.cobertura.xml | ||
targetdir: ${{ env.SOLUTION_DIR }}TestResults/coverage | ||
reporttypes: HtmlInline | ||
toolpath: ${{ env.SOLUTION_DIR }}report-generator-tool | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: testresults-dotnet-${{ matrix.dotnet-version }} | ||
path: ${{ env.SOLUTION_DIR }}TestResults |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# | ||
# This workflow will build and run tests for the Microsoft.Bot.Builder.M365 .NET SDK. | ||
# | ||
|
||
name: dotnet-pr | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- DOTNET | ||
paths: | ||
- 'dotnet/packages/**' | ||
|
||
jobs: | ||
dotnet-build-test: | ||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
dotnet-version: ['6.0', '7.0'] | ||
configuration: [Release] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
SOLUTION_DIR: dotnet/packages/Microsoft.Bot.Builder.M365/ | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
with: | ||
clean: true | ||
|
||
- name: Setup .NET SDK ${{ matrix.dotnet-version }} | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
- name: Restore | ||
shell: bash | ||
working-directory: ${{ env.SOLUTION_DIR }} | ||
run: dotnet restore Microsoft.Bot.Builder.M365.sln | ||
|
||
- name: Build | ||
shell: bash | ||
working-directory: ${{ env.SOLUTION_DIR }} | ||
run: dotnet build Microsoft.Bot.Builder.M365.sln --no-restore --configuration ${{ matrix.configuration }} | ||
|
||
- name: Test | ||
shell: bash | ||
working-directory: ${{ env.SOLUTION_DIR }} | ||
run: dotnet test Microsoft.Bot.Builder.M365.Tests/Microsoft.Bot.Builder.M365.Tests.csproj --no-restore --verbosity normal --logger trx --results-directory ./TestResults --collect:"XPlat Code Coverage" --configuration ${{ matrix.configuration }} | ||
|
||
- name: Generate coverage report | ||
uses: danielpalme/ReportGenerator-GitHub-Action@5.1.22 | ||
with: | ||
reports: ${{ env.SOLUTION_DIR }}TestResults/*/coverage.cobertura.xml | ||
targetdir: ${{ env.SOLUTION_DIR }}TestResults/coverage | ||
reporttypes: TextSummary | ||
toolpath: ${{ env.SOLUTION_DIR }}report-generator-tool | ||
|
||
- name: Show coverage | ||
shell: bash | ||
run: cat ${{ env.SOLUTION_DIR }}TestResults/coverage/*.txt |
Oops, something went wrong.