Skip to content

Commit 8d42788

Browse files
authored
add ci best practise (#50)
1 parent 5f359fb commit 8d42788

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,46 @@ jobs:
2222
with:
2323
access_token: ${{ github.token }}
2424

25-
- uses: actions/checkout@v4
25+
- name: Checkout code
26+
uses: actions/checkout@v4
2627
with:
2728
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
2829

29-
- name: 'Install .NET SDK'
30+
- name: Setup .NET SDK
3031
uses: actions/setup-dotnet@v4
3132
with:
3233
global-json-file: ./global.json
3334

34-
- name: Versioning
35+
- name: Restore dependencies
36+
run: dotnet restore
37+
38+
- name: Setup Git Versioning
3539
uses: dotnet/nbgv@master
3640
id: nbgv
3741

38-
- name: Version Info
42+
- name: Show Version Info
3943
run: |
4044
echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'
4145
4246
- name: Build with dotnet
4347
run: dotnet build
44-
--configuration ${{ env.BuildConfig }}
48+
--no-restore --configuration ${{ env.BuildConfig }}
4549
/p:Version=${{ steps.nbgv.outputs.AssemblyVersion }}
4650

4751
- name: Test with dotnet
4852
run: dotnet test
53+
--no-build --configuration ${{ env.BuildConfig }}
54+
--logger "trx;LogFileName=test-results.trx" --results-directory ./artifacts/testResults
55+
continue-on-error: true
56+
57+
- name: Test Report
58+
uses: dorny/test-reporter@v1
59+
if: always()
60+
with:
61+
name: DotNET Tests
62+
path: "./artifacts/testResults/test-results.trx"
63+
reporter: dotnet-trx
64+
fail-on-error: true
4965

5066
- name: Pack NuGet
5167
run: dotnet pack

0 commit comments

Comments
 (0)