Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check for benchmark-relevant changes
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: filter
with:
filters: |
relevant:
- 'source/Handlebars/**'
- 'source/Handlebars.Benchmark/**'
- 'source/Directory.Build.props'
- 'source/Handlebars.sln'

- uses: actions/setup-dotnet@v4
if: steps.filter.outputs.relevant == 'true'
with:
dotnet-version: |
6.0.x
10.0.x
- name: Run benchmark
if: steps.filter.outputs.relevant == 'true'
working-directory: ./source/Handlebars.Benchmark
run: dotnet run -c Release -f net10.0 --exporters json --filter '*' --join
- name: Get benchmark file name
if: steps.filter.outputs.relevant == 'true'
working-directory: ./source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results
id: benchmarkfilename
run: |
filePath=$(find . -type f -name 'BenchmarkRun-joined-*-report-full-compressed.json' | rev | cut -d '/' -f1 | rev)
echo $filePath
echo "file=$filePath" >> $GITHUB_OUTPUT
- name: Store benchmark result
if: steps.filter.outputs.relevant == 'true'
uses: Happypig375/github-action-benchmark@e7cb068f90622402c0ae5b54e2c781052fcd9343 # v1.8.2
with:
name: Benchmark.Net Benchmark
Expand All @@ -125,7 +141,12 @@ jobs:
fail-on-alert: false
alert-comment-cc-users: '@zjklee'
- name: Upload Artifacts
if: steps.filter.outputs.relevant == 'true'
uses: actions/upload-artifact@v4
with:
name: Benchmark
path: source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results/

- name: Skipped
if: steps.filter.outputs.relevant != 'true'
run: echo "No changes under source/Handlebars or source/Handlebars.Benchmark — skipping benchmark run."
Loading