Benchmarks #2
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: Benchmarks | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_NOLOGO: 1 | |
| benchmarksPath: './benchmarks/DurationMancer.Benchmarks/DurationMancer.Benchmarks.csproj' | |
| buildConfiguration: 'Release' | |
| jobs: | |
| benchmarks: | |
| name: Run Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Code checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis and for GitVersion based versioning | |
| # --- GitVersion --- | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v4.2.0 | |
| with: | |
| versionSpec: '6.5.x' | |
| - name: Determine Version | |
| id: version_step # step id used as reference for output values | |
| uses: gittools/actions/gitversion/command@v4.2.0 | |
| with: | |
| arguments: '/output buildserver /l console /config GitVersion.yaml /updateprojectfiles' # have to self-define all arguments; /updateprojectfiles not impl. in execute task | |
| # --- Setup .NET --- | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| 10.0.x | |
| # --- Restore --- | |
| - name: Restore | |
| run: dotnet restore ${{ env.benchmarksPath }} | |
| # --- Build --- | |
| - name: Build ${{ env.GitVersion_FullSemVer }} | |
| run: dotnet build ${{ env.benchmarksPath }} --no-restore -c Release | |
| # --- Run Benchmarks --- | |
| - name: Run Benchmarks for ${{ env.GitVersion_FullSemVer }} | |
| run: dotnet run --project ${{ env.benchmarksPath }} --no-build -c Release -f net10.0 | |
| # --- Publish Benchmark Results --- | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: BenchmarkResults-${{ env.GitVersion_FullSemVer }} | |
| path: ./BenchmarkDotNet.Artifacts/results | |
| retention-days: 30 |