Skip to content

Commit

Permalink
feat: added benchmark reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
aochmann committed Jun 11, 2021
1 parent 271cd98 commit 2e2ea39
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 41 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
env:
ReportOutput: '${{github.workspace}}'
TestReportFileName: 'TestReport.${{github.run_number}}.md'

BENCHMARK_PROJECT: 'Source\tests\BenchmarkTests\Cogworks.Essentials.BenchmarkTests\Cogworks.Essentials.BenchmarkTests.csproj'
BENCHMARK_REPORT: 'Cogworks.Essentials.BenchmarkTests.Benchmarks.MemoryCacheBenchmark-report-github.md'
BENCHMARK_REPORT_OUTPUT: '${{github.workspace}}\BenchmarkDotNet.Artifacts\results'

ACTIONS_ALLOW_UNSECURE_COMMANDS: true

# Dotnet Setup
Expand Down Expand Up @@ -101,6 +106,30 @@ jobs:
name: results
path: ${{ env.ReportOutput}}\${{ env.TestReportFileName }}

- name: Run Benchmark
shell: powershell
run: |
dotnet run `
-p "${{ env.BENCHMARK_PROJECT }}" `
-c ${{ env.CONFIG }} `
-f netcoreapp3.1 `
--no-build `
--no-restore `
--runtimes netcoreapp31 `
--filter * `
--join `
--warmupCount 1 `
--minIterationCount 9 `
--maxIterationCount 10 `
--iterationCount 5 `
--strategy ColdStart
- name: Upload benchmark results
uses: actions/upload-artifact@v2
with:
name: benchmark-results
path: ${{ env.BENCHMARK_REPORT_OUTPUT }}\${{ env.BENCHMARK_REPORT }}

commenting:
needs: build-and-test
runs-on: ubuntu-latest
Expand All @@ -112,9 +141,20 @@ jobs:
with:
name: results

- name: Comment PR
- uses: actions/download-artifact@v1
with:
name: benchmark-results

- name: Comment PR - test report
uses: machine-learning-apps/pr-comment@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: results/${{ env.TestReportFileName }}

- name: Comment PR - benchmark report
uses: machine-learning-apps/pr-comment@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: benchmark-results/${{ env.BENCHMARK_REPORT }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,5 @@ Source/**/*GeneratedMSBuildEditorConfig.editorconfig

dist/
output/

BenchmarkDotNet.Artifacts/*

0 comments on commit 2e2ea39

Please sign in to comment.