Bump actions/upload-artifact action to v5 (#534) #572
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: benchmark | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| DOTNET_NOLOGO: true | |
| DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1 | |
| NUGET_XMLDOC_MODE: skip | |
| TERM: xterm | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dotnet-vnext | |
| - dotnet-nightly | |
| paths-ignore: | |
| - '**/*.gitattributes' | |
| - '**/*.gitignore' | |
| - '**/*.md' | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| benchmark: | |
| name: benchmark | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| filter: 'tree:0' | |
| persist-credentials: false | |
| show-progress: false | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 | |
| - name: Run benchmarks | |
| shell: pwsh | |
| run: ./benchmark.ps1 | |
| - name: Publish BenchmarkDotNet artifacts | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: artifacts | |
| path: ./BenchmarkDotNet.Artifacts/results/* | |
| if-no-files-found: error | |
| - name: Get repository name | |
| id: get-repo-name | |
| shell: pwsh | |
| run: | | |
| $repoName = ${env:GITHUB_REPOSITORY}.Split("/")[-1] | |
| "repo-name=${repoName}" >> ${env:GITHUB_OUTPUT} | |
| - name: Publish results | |
| uses: martincostello/benchmarkdotnet-results-publisher@8ec1d7f1ee9854674aabb3f2b06a5afae1bec8ae # v2.0.1 | |
| with: | |
| branch: ${{ github.ref_name }} | |
| comment-on-threshold: true | |
| name: 'ASP.NET Core OpenAPI' | |
| output-file-path: '${{ steps.get-repo-name.outputs.repo-name }}/data.json' | |
| repo: '${{ github.repository_owner }}/benchmarks' | |
| repo-token: ${{ secrets.BENCHMARKS_TOKEN }} | |
| - name: Output summary | |
| shell: pwsh | |
| env: | |
| REPO_NAME: ${{ steps.get-repo-name.outputs.repo-name }} | |
| run: | | |
| $summary += "`n`n" | |
| $summary += "View benchmark results history [here](https://benchmarks.martincostello.com/?repo=${env:REPO_NAME}&branch=${env:GITHUB_REF_NAME})." | |
| $summary >> ${env:GITHUB_STEP_SUMMARY} |