Skip to content

Commit fe90e51

Browse files
committed
updated
1 parent 1d8414c commit fe90e51

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

.github/workflows/dotnet-desktop.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,29 @@ jobs:
7070
- name: Build
7171
run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore
7272

73-
# Only run the packaging and publishing steps if we're pushing a tag
73+
- name: Test with xUnit
74+
continue-on-error: true
75+
run: |
76+
dotnet test ${{ env.TEST_PROJECT_PATH }} \
77+
--configuration Release \
78+
--no-build \
79+
--logger "console;verbosity=detailed" \
80+
--logger "trx;LogFileName=test-results.trx" \
81+
--collect:"XPlat Code Coverage" \
82+
--results-directory ./test-results
83+
84+
- name: Upload test results
85+
if: always() # Upload test results even if tests fail
86+
uses: actions/upload-artifact@v3
87+
with:
88+
name: test-results
89+
path: |
90+
./test-results/*.trx
91+
./test-results/**/coverage.cobertura.xml
92+
if-no-files-found: warn
93+
7494
- name: Pack
75-
if: startsWith(github.ref, 'refs/tags/v')
7695
run: dotnet pack ${{ env.PACKAGE_PROJECT_PATH }} --configuration Release --no-build --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
7796

7897
- name: Publish to NuGet
79-
if: startsWith(github.ref, 'refs/tags/v')
8098
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg --source ${{ env.NUGET_SOURCE_URL }} --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

0 commit comments

Comments
 (0)