-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from thecogworks/feat/benchmar-tests
feat: memory cache benchmarks
- Loading branch information
Showing
11 changed files
with
414 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Benchmark | ||
on: | ||
pull_request: | ||
|
||
env: | ||
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 | ||
DOTNET_VERSION: 3.1.401 | ||
|
||
# Stop wasting time caching packages | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
|
||
# Disable sending usage data to Microsoft | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
|
||
# Solution Setup | ||
CONFIG: 'Release' | ||
|
||
# Nuget Setup | ||
NUGET_VERSION: 'latest' | ||
|
||
jobs: | ||
build-and-benchmark: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout commit | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup MSBuild | ||
uses: microsoft/setup-msbuild@v1 | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Configure NuGet | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-version: ${{ env.NUGET_VERSION }} | ||
|
||
- name: NuGet Restore | ||
shell: powershell | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
$solutions = Get-ChildItem -Path . -Recurse -Include *.sln | ||
foreach ($solutionFile in $solutions){ | ||
nuget restore "$solutionFile" | ||
} | ||
- name: Install Dependencies | ||
shell: powershell | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
$solutions = Get-ChildItem -Path . -Recurse -Include *.sln | ||
foreach ($solutionFile in $solutions){ | ||
dotnet restore "$solutionFile" | ||
} | ||
- name: Build | ||
shell: powershell | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
$solutions = Get-ChildItem -Path . -Recurse -Include *.sln | ||
foreach ($solutionFile in $solutions){ | ||
msbuild.exe "$solutionFile" ` | ||
/p:Configuration=${{ env.CONFIG }} ` | ||
/p:DeployOnBuild=false ` | ||
/p:SkipInvalidConfigurations=true ` | ||
/p:TransformWebConfigEnabled=False ` | ||
/p:AutoParameterizationWebConfigConnectionStrings=False ` | ||
/p:MarkWebConfigAssistFilesAsExclude=False | ||
} | ||
- name: Run Benchmark | ||
shell: powershell | ||
run: | | ||
dotnet run ` | ||
-p "${{ env.BENCHMARK_PROJECT }}" ` | ||
-c ${{ env.CONFIG }} ` | ||
-f netcoreapp3.1 ` | ||
--no-build ` | ||
--no-restore ` | ||
--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-benchmark | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout commit | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: benchmark-results | ||
|
||
- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,3 +221,5 @@ Source/**/*GeneratedMSBuildEditorConfig.editorconfig | |
|
||
dist/ | ||
output/ | ||
|
||
BenchmarkDotNet.Artifacts/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Source/tests/BenchmarkTests/Cogworks.Essentials.BenchmarkTests/.editorconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[*.cs] | ||
|
||
# CA1822: Mark members as static | ||
dotnet_diagnostic.CA1822.severity = none | ||
|
||
# IDE0059: Unnecessary assignment of a value | ||
csharp_style_unused_value_assignment_preference = unused_local_variable | ||
|
||
# SA1402: File may only contain a single type | ||
dotnet_diagnostic.SA1402.severity = none | ||
|
||
# CS8019: Unnecessary using directive | ||
dotnet_diagnostic.CS8019.severity = none |
1 change: 1 addition & 0 deletions
1
Source/tests/BenchmarkTests/Cogworks.Essentials.BenchmarkTests/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BenchmarkDotNet.Artifacts/* |
Oops, something went wrong.