#19 Fix publish command to compare the last two commits (HEAD~1 and…
#45
This file contains hidden or 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
| name: Build and Test | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.406 | |
| - name: Restore dependencies | |
| run: dotnet restore --packages ./packages | |
| - name: Build | |
| run: dotnet build -c Release --no-restore | |
| - name: Test | |
| run: dotnet test -c Release --no-restore --no-build --verbosity normal | |
| - name: Pack | |
| run: dotnet pack -c Release --no-restore --no-build | |
| - name: Upload NuGet package as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-package | |
| path: ./nupkg/*.nupkg | |
| - name: Format | |
| run: dotnet format --no-restore --verify-no-changes |