Skip to content

Commit

Permalink
add ci best practise (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminAbt authored Nov 1, 2024
1 parent 5f359fb commit 8d42788
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,46 @@ jobs:
with:
access_token: ${{ github.token }}

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

- name: 'Install .NET SDK'
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json

- name: Versioning
- name: Restore dependencies
run: dotnet restore

- name: Setup Git Versioning
uses: dotnet/nbgv@master
id: nbgv

- name: Version Info
- name: Show Version Info
run: |
echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'
- name: Build with dotnet
run: dotnet build
--configuration ${{ env.BuildConfig }}
--no-restore --configuration ${{ env.BuildConfig }}
/p:Version=${{ steps.nbgv.outputs.AssemblyVersion }}

- name: Test with dotnet
run: dotnet test
--no-build --configuration ${{ env.BuildConfig }}
--logger "trx;LogFileName=test-results.trx" --results-directory ./artifacts/testResults
continue-on-error: true

- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: DotNET Tests
path: "./artifacts/testResults/test-results.trx"
reporter: dotnet-trx
fail-on-error: true

- name: Pack NuGet
run: dotnet pack
Expand Down

0 comments on commit 8d42788

Please sign in to comment.