Skip to content
Closed
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
50 changes: 44 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,60 @@ on:
push:
branches:
- dev

workflow_dispatch:

concurrency:
group: mudextensions-deploy
cancel-in-progress: true

permissions:
contents: read
packages: write

jobs:
deploy:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Deploy to Server via SSH
- name: Checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/codebeamorg/codebeam.mudblazor.extensions:dev
ghcr.io/codebeamorg/codebeam.mudblazor.extensions:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Deploy to Server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
set -e

cd ~/apps/CodeBeam.MudBlazor.Extensions
git pull origin dev
docker compose up -d --build


git fetch origin dev
git reset --hard origin/dev

docker compose pull
docker compose up -d --remove-orphans

docker image prune -f
39 changes: 39 additions & 0 deletions .github/workflows/virtualization-benchmark-probe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Virtualization benchmark probe

on:
push:
branches:
- upstream/benchmarks-virtualized-select-selection-state
pull_request:
branches:
- dev
paths:
- 'benchmarks/**'
- '.github/workflows/virtualization-benchmark-probe.yml'
workflow_dispatch:

jobs:
probe:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Run upstream-to-PR1 structural probe
shell: pwsh
run: ./benchmarks/run-virtualization-benchmarks.ps1 -ProbeOnly -BaselineRef "7b5faf7ebb7666558d13c447313e9b09c92a110d" -FixedRef "e7020d49a824a371ab3f3450255f10d9cfad8783" -ResultsDirectory "$env:GITHUB_WORKSPACE/benchmark-results"

- name: Upload probe results
if: always()
uses: actions/upload-artifact@v4
with:
name: virtualization-benchmark-probe
path: benchmark-results
5 changes: 5 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:80 {
root * /usr/share/caddy
file_server
try_files {path} /index.html
}
3 changes: 3 additions & 0 deletions CodeBeamMudExtensions.slnx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Solution>
<Folder Name="/benchmarks/">
<Project Path="benchmarks/CodeBeam.MudBlazor.Extensions.Benchmarks/CodeBeam.MudBlazor.Extensions.Benchmarks.csproj" />
</Folder>
<Folder Name="/docs/">
<Project Path="docs/CodeBeam.MudBlazor.Extensions.Docs.Server/CodeBeam.MudBlazor.Extensions.Docs.Server.csproj" />
<Project Path="docs/CodeBeam.MudBlazor.Extensions.Docs.Wasm/CodeBeam.MudBlazor.Extensions.Docs.Wasm.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Bunit;
using Microsoft.Extensions.DependencyInjection;
using MudBlazor.Services;
using MudExtensions.Services;

namespace MudExtensions.Benchmarks;

internal static class BenchmarkBunitContext
{
public static BunitContext Create()
{
var context = new BunitContext();
context.JSInterop.Mode = JSRuntimeMode.Loose;
context.Services.AddMudServices(options =>
{
options.SnackbarConfiguration.ShowTransitionDuration = 0;
options.SnackbarConfiguration.HideTransitionDuration = 0;
options.PopoverOptions.CheckForPopoverProvider = false;
});
context.Services.AddMudExtensions();
return context;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<RootNamespace>MudExtensions.Benchmarks</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<PackageReference Include="bunit" Version="2.4.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\CodeBeam.MudBlazor.Extensions\CodeBeam.MudBlazor.Extensions.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using BenchmarkDotNet.Attributes;
using Bunit;

namespace MudExtensions.Benchmarks;

[MemoryDiagnoser]
[BenchmarkCategory("MudListExtended", "InitialRender")]
public class ListExtendedInitialRenderBenchmarks
{
private List<int?> _items = null!;
private int?[] _selectedValues = null!;

[Params(10, 100, 1_000, 4_000)]
public int ItemCount { get; set; }

[Params(false, true)]
public bool Virtualize { get; set; }

[GlobalSetup]
public void Setup()
{
_items = Enumerable.Range(1, ItemCount).Select(static value => (int?)value).ToList();
_selectedValues = [1, ItemCount];
}

[Benchmark]
public async Task<int> RenderList()
{
await using var context = BenchmarkBunitContext.Create();
var cut = context.Render<MudListExtended<int?>>(parameters => parameters
.Add(x => x.ItemCollection, _items)
.Add(x => x.Virtualize, Virtualize)
.Add(x => x.MultiSelection, true)
.Add(x => x.SelectedValues, _selectedValues));

return cut.RenderCount;
}
}
10 changes: 10 additions & 0 deletions benchmarks/CodeBeam.MudBlazor.Extensions.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using BenchmarkDotNet.Running;
using MudExtensions.Benchmarks;

if (args.Length > 0 && string.Equals(args[0], "probe", StringComparison.OrdinalIgnoreCase))
{
return await ScaleProbe.RunAsync(args[1..]);
}

BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
return 0;
Loading
Loading