Various minor perf tweaks #95
Workflow file for this run
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
name: Build and Test | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- 'samples/**' | |
- 'experiments/**' | |
- 'README.md' | |
- 'CHANGELOG.md' | |
push: | |
tags: | |
- '*' | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- 'samples/**' | |
- 'experiments/**' | |
- 'README.md' | |
- 'CHANGELOG.md' | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core 6 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Setup .NET Core 7 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Setup .NET Core 8 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore tools | |
run: dotnet tool restore | |
- name: Set version | |
run: | | |
dotnet gitversion /updateprojectfiles /output json > $HOME/version.json | |
echo "GITVERSION=$(jq -c . < $HOME/version.json)" >> $GITHUB_ENV | |
- name: Restore NuGet packages | |
run: dotnet restore | |
- name: Build the project | |
run: dotnet build --configuration Release | |
- name: Run unit tests | |
run: dotnet test | |
- name: Pack NuGet package | |
if: ${{ success() && github.event_name != 'pull_request' }} | |
run: dotnet pack --configuration Release --output ./nupkg | |
- name: Setup NuGet | |
if: ${{ success() && github.event_name != 'pull_request' }} | |
uses: nuget/setup-nuget@v1 | |
with: | |
nuget-api-key: ${{ secrets.NUGET_API_KEY }} | |
- name: Push generated package to GitHub registry | |
if: ${{ success() && github.event_name != 'pull_request' }} | |
run: nuget push "**/*.nupkg" -Source https://api.nuget.org/v3/index.json -SkipDuplicate |