Skip to content

Commit ecfadda

Browse files
Added workflow file for new Github Actions benchmark
2 parents fa51ef4 + fb9be8a commit ecfadda

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: MiniExcel Benchmarks
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
QueryBenchmark:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: 9.0.x
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
working-directory: ./benchmarks/MiniExcel.Benchmarks
23+
- name: Build
24+
run: dotnet build --no-restore
25+
working-directory: ./benchmarks/MiniExcel.Benchmarks
26+
- name: Benchmark
27+
run: dotnet run -c Release -f net9.0
28+
working-directory: ./benchmarks/MiniExcel.Benchmarks
29+
env:
30+
BenchmarkMode: Automatic
31+
BenchmarkSection: query
32+
- name: Commit report
33+
working-directory: ./benchmarks
34+
run: |
35+
cp -r ./MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results ./
36+
git config user.name github-actions
37+
git config user.email [email protected]
38+
git pull
39+
cd ./results
40+
git add '*.md'
41+
git commit -am "Automated benchmark report - query section"
42+
git push --force
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
CreateBenchmark:
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Setup .NET
52+
uses: actions/setup-dotnet@v4
53+
with:
54+
dotnet-version: 9.0.x
55+
- name: Restore dependencies
56+
run: dotnet restore
57+
working-directory: ./benchmarks/MiniExcel.Benchmarks
58+
- name: Build
59+
run: dotnet build --no-restore
60+
working-directory: ./benchmarks/MiniExcel.Benchmarks
61+
- name: Benchmark
62+
run: dotnet run -c Release -f net9.0
63+
working-directory: ./benchmarks/MiniExcel.Benchmarks
64+
env:
65+
BenchmarkMode: Automatic
66+
BenchmarkSection: create
67+
- name: Commit report
68+
working-directory: ./benchmarks
69+
run: |
70+
cp -r ./MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results ./
71+
git config user.name github-actions
72+
git config user.email [email protected]
73+
git pull
74+
cd ./results
75+
git add '*.md'
76+
git commit -am "Automated benchmark report - create section"
77+
git push --force
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
TemplateBenchmark:
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- uses: actions/checkout@v4
86+
- name: Setup .NET
87+
uses: actions/setup-dotnet@v4
88+
with:
89+
dotnet-version: 9.0.x
90+
- name: Restore dependencies
91+
run: dotnet restore
92+
working-directory: ./benchmarks/MiniExcel.Benchmarks
93+
- name: Build
94+
run: dotnet build --no-restore
95+
working-directory: ./benchmarks/MiniExcel.Benchmarks
96+
- name: Benchmark
97+
run: dotnet run -c Release -f net9.0
98+
working-directory: ./benchmarks/MiniExcel.Benchmarks
99+
env:
100+
BenchmarkMode: Automatic
101+
BenchmarkSection: template
102+
- name: Commit report
103+
working-directory: ./benchmarks
104+
run: |
105+
cp -r ./MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results ./
106+
git config user.name github-actions
107+
git config user.email [email protected]
108+
git pull
109+
cd ./results
110+
git add '*.md'
111+
git commit -am "Automated benchmark report - template section"
112+
git push --force
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)