File tree Expand file tree Collapse file tree 4 files changed +32
-65
lines changed Expand file tree Collapse file tree 4 files changed +32
-65
lines changed Original file line number Diff line number Diff line change 1
- name : Benchmark
1
+ name : Benchmark
2
2
on :
3
3
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'
7
9
jobs :
8
10
benchmark :
9
11
runs-on : ubuntu-latest
10
12
permissions :
13
+ # deployments permission to deploy GitHub pages website
14
+ deployments : write
15
+ # contents permission to update benchmark contents in gh-pages branch
11
16
contents : write
12
17
steps :
13
- - name : 🤖 defaults
14
- uses : devlooped/ actions-bot@v1
18
+ - uses : actions/checkout@v4
19
+ - uses : actions/setup-go@v4
15
20
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
23
24
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
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
22
23
23
<ItemGroup >
24
24
<ProjectProperty Include =" MSBuildProjectDirectory" />
25
+ <ProjectProperty Include =" RepositoryRoot" />
25
26
</ItemGroup >
26
27
27
28
</Project >
Original file line number Diff line number Diff line change 1
1
git pull && `
2
2
pushd .\src\AI.Benchmarks && `
3
- dotnet run - c Release && `
3
+ dotnet run - c Release
4
+
5
+ if (-not $? ) { throw ' Failed to run benchmarks' }
6
+
4
7
jq - r ' .HostEnvironmentInfo.ChronometerFrequency.Hertz as $ticks |
5
8
.Benchmarks[] |
6
9
{
@@ -12,9 +15,11 @@ jq -r '.HostEnvironmentInfo.ChronometerFrequency.Hertz as $ticks |
12
15
Model: .Parameters[11:],
13
16
# express as seconds to match markdown
14
17
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'
You can’t perform that action at this time.
0 commit comments