Skip to content

Commit e9c5274

Browse files
committed
Fix workflow and report path
1 parent de35adc commit e9c5274

File tree

4 files changed

+32
-65
lines changed

4 files changed

+32
-65
lines changed

.github/workflows/benchmark.yml

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
1-
name: Benchmark
1+
name: Benchmark
22
on:
33
workflow_dispatch:
4-
schedule:
5-
- cron: "0 2 1 * *"
6-
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'src/AI.Benchmarks/BenchmarkDotNet.Artifacts/results/AI.Benchmarks.ModelPerformance-report-full.json'
79
jobs:
810
benchmark:
911
runs-on: ubuntu-latest
1012
permissions:
13+
# deployments permission to deploy GitHub pages website
14+
deployments: write
15+
# contents permission to update benchmark contents in gh-pages branch
1116
contents: write
1217
steps:
13-
- name: 🤖 defaults
14-
uses: devlooped/actions-bot@v1
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-go@v4
1520
with:
16-
name: ${{ secrets.BOT_NAME }}
17-
email: ${{ secrets.BOT_EMAIL }}
18-
gh_token: ${{ secrets.GH_TOKEN }}
19-
github_token: ${{ secrets.GITHUB_TOKEN }}
20-
21-
- name: 🤘 checkout
22-
uses: actions/checkout@v4
21+
go-version: "stable"
22+
# gh-pages branch is updated and pushed automatically with extracted benchmark data
23+
- uses: benchmark-action/github-action-benchmark@v1
2324
with:
24-
token: ${{ env.GH_TOKEN }}
25-
26-
- name: ⚙ update
27-
working-directory: src/AI.Benchmarks
28-
run: dotnet run -c Release
29-
30-
- name: +Mᐁ includes
31-
uses: devlooped/actions-includes@v1
32-
33-
- name: ⬆️ commit
34-
run: |
35-
git add *.json
36-
git add *.md
37-
git commit -m "🖉 Update AI benchmarks"
38-
git pull
39-
git push
25+
tool: 'benchmarkdotnet'
26+
output-file-path: 'src/AI.Benchmarks/BenchmarkDotNet.Artifacts/results/AI.Benchmarks.ModelPerformance-report-full.json'
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
# Push and deploy GitHub pages branch automatically
29+
auto-push: true

.github/workflows/benchmarks.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/AI.Benchmarks/AI.Benchmarks.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<ItemGroup>
2424
<ProjectProperty Include="MSBuildProjectDirectory" />
25+
<ProjectProperty Include="RepositoryRoot" />
2526
</ItemGroup>
2627

2728
</Project>

update.ps1

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
git pull && `
22
pushd .\src\AI.Benchmarks && `
3-
dotnet run -c Release && `
3+
dotnet run -c Release
4+
5+
if (-not $?) { throw 'Failed to run benchmarks' }
6+
47
jq -r '.HostEnvironmentInfo.ChronometerFrequency.Hertz as $ticks |
58
.Benchmarks[] |
69
{
@@ -12,9 +15,11 @@ jq -r '.HostEnvironmentInfo.ChronometerFrequency.Hertz as $ticks |
1215
Model: .Parameters[11:],
1316
# express as seconds to match markdown
1417
Mean: ((.Statistics.Mean / $ticks) | . * 10 | floor | . / 1000)
15-
}' .\BenchmarkDotNet.Artifacts\results\AI.Benchmarks.ModelPerformance-report-full-compressed.json > .\BenchmarkDotNet.Artifacts\results\summary.json && `
16-
popd && `
17-
add *.json && `
18-
add *.md && `
19-
commit -m "🖉 Update AI benchmarks" && `
20-
git push || write-host 'Failed to update benchmarks'
18+
}' .\BenchmarkDotNet.Artifacts\results\AI.Benchmarks.ModelPerformance-report-full.json > .\BenchmarkDotNet.Artifacts\results\summary.json
19+
20+
if (-not $?) { throw 'Failed to create summary' }
21+
22+
add *.json
23+
add *.md
24+
commit -m "🖉 Update AI benchmarks"
25+
git push || write-host 'Failed to push updated benchmarks'

0 commit comments

Comments
 (0)