Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,32 @@ jobs:
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal

benchmark-on-pr:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Setup .NET 9
uses: actions/setup-dotnet@v1
with:
dotnet-version: '9.0.x'

- name: Ensure results directory exists
run: |
mkdir -p benchmark/Razor.Template.Core.PerfBenchmark/results
touch benchmark/Razor.Template.Core.PerfBenchmark/results/.gitkeep

- name: Run benchmark
run: dotnet run -c Release --project benchmark/Razor.Template.Core.PerfBenchmark/Razor.Template.Core.PerfBenchmark.csproj

- name: Commit benchmark results
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add benchmark/Razor.Template.Core.PerfBenchmark/results/
git commit -m "chore: update benchmark report [skip ci]" || echo "No changes to commit"
git push origin HEAD:${{ github.head_ref }}
4 changes: 3 additions & 1 deletion benchmark/Razor.Template.Core.PerfBenchmark/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Analysers;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Exporters;
Expand All @@ -8,6 +9,7 @@

var config = ManualConfig.CreateMinimumViable()
.AddExporter(MarkdownExporter.GitHub)
.AddAnalyser(EnvironmentAnalyser.Default)
.WithArtifactsPath(".");

BenchmarkRunner.Run<RazorTemplatingCoreBenchMark>(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Empty file.

This file was deleted.