Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
8297f0e
feat: implement Visited Places cache with initial project structure a…
Mar 7, 2026
06bb991
feat(visited-places): implement Visited Places cache with data genera…
Mar 7, 2026
ef86217
refactor(eviction): unify just-stored segment handling and improve ev…
Mar 7, 2026
55cd1e0
refactor(SnapshotAppendBufferStorage): move configuration value to se…
Mar 7, 2026
625c2af
refactor(eviction): update eviction policies and selectors for improv…
Mar 7, 2026
3d0a5bd
refactor(eviction): remove unnecessary statistics from CachedSegment …
Mar 7, 2026
bc091c3
refactor(eviction): update pressure classes to use nested types for c…
Mar 7, 2026
bae8c9d
refactor(eviction): enhance SmallestFirstEvictionSelector with cached…
Mar 7, 2026
99762bd
refactor(eviction): implement sampling-based eviction strategy for se…
Mar 8, 2026
6f7cd35
refactor(eviction): update metadata handling in eviction selectors; s…
Mar 8, 2026
dc0c89a
refactor(eviction): simplify pressure evaluation logic in BackgroundE…
Mar 8, 2026
25f9823
refactor(eviction): add TODO comment regarding sync method behavior w…
Mar 8, 2026
befba58
refactor(visited-places-cache): update constructor parameters to sugg…
Mar 8, 2026
7fcec4b
refactor(visited-places-cache): update storage strategy options to us…
Mar 8, 2026
fd8a910
refactor(visited-places-cache): update constructor documentation to c…
Mar 8, 2026
f27c1cc
refactor(eviction): encapsulate eviction policy lifecycle and evaluat…
Mar 8, 2026
4f1f6ca
refactor(eviction): encapsulate eviction logic within a new EvictionE…
Mar 8, 2026
f137da8
refactor(cache-normalization): rename BackgroundEventProcessor to Cac…
Mar 8, 2026
b101b84
chore: update xunit.runner.visualstudio package version to 2.8.2 in t…
Mar 8, 2026
87ffeb3
refactor(eviction): improve XML documentation formatting in EvictionP…
Mar 8, 2026
a45da65
refactor(eviction): remove unnecessary timestamp parameters from meta…
Mar 8, 2026
9b55085
fix: ensure ThreadPool execution via Task.Yield() in ChainExecutionAs…
Mar 8, 2026
b817adb
refactor(work-scheduler): remove unnecessary comments regarding Func …
Mar 8, 2026
ca9310b
refactor(diagnostics): rename ICacheDiagnostics to IVisitedPlacesCach…
Mar 8, 2026
a29ec61
refactor(eviction): improve XML documentation formatting in EvictionE…
Mar 8, 2026
0f2cad1
refactor(data-sources): replace List with Array for data generation m…
Mar 8, 2026
ff87eac
refactor(UserRequestHandler): optimize memory handling by using IEnum…
Mar 8, 2026
3f57296
refactor(UserRequestHandler): optimize memory usage by utilizing IEnu…
Mar 9, 2026
6585ff3
refactor(UserRequestHandler): improve data assembly by utilizing Rang…
Mar 9, 2026
c2df2a1
refactor(UserRequestHandler): optimize data handling by replacing Lis…
Mar 9, 2026
4171f65
refactor(UserRequestHandler): optimize memory allocations by reducing…
Mar 9, 2026
fa5fa6d
refactor(UserRequestHandler): optimize memory allocations by utilizin…
Mar 10, 2026
e0fe16c
feat(ttl): implement TTL expiration for cached segments with diagnost…
Mar 11, 2026
782e511
docs: update diagnostics documentation with execution context and thr…
Mar 11, 2026
225083c
refactor: rename TaskBasedWorkScheduler and ChannelBasedWorkScheduler…
Mar 11, 2026
f89f8b4
feat(scheduler): implement bounded and unbounded serial work schedule…
Mar 11, 2026
eb540a6
refactor(TtlExpirationWorkItem): replace private cancellation token f…
Mar 11, 2026
c8a0eaf
refactor(VisitedPlacesCache): replace cancellation token cancellation…
Mar 11, 2026
c244f76
refactor: diagnostics interfaces have been updated to include new cac…
Mar 12, 2026
69d57a2
refactor(TtlEngine): encapsulate TTL subsystem and simplify CacheNorm…
Mar 12, 2026
6cb9ace
fix: update imports to include new scheduling infrastructure components
Mar 12, 2026
b968d26
refactor(CacheNormalizationExecutor): simplify eviction candidate sel…
Mar 12, 2026
3ac7b5c
refactor: update segment removal methods to use TryRemove and TryGetR…
Mar 12, 2026
1df6ea7
refactor: extract common logic into SegmentStorageBase; simplify segm…
Mar 12, 2026
1993465
refactor: improve segment intersection logic and enhance documentatio…
Mar 12, 2026
c36cc48
feat: concrete eviction types have been made public; refactor: NoOp s…
Mar 12, 2026
2d483e2
docs: AGENTS.md has been updated with code style guidelines for brace…
Mar 12, 2026
7dbe92a
refactor: update paths for SlidingWindow and VisitedPlaces projects i…
Mar 12, 2026
64318cb
docs: code comments have been enhanced for clarity and allocation notes;
Mar 13, 2026
aad47f9
refactor: optimize gap computation logic to eliminate closure allocat…
Mar 13, 2026
2a8f350
refactor: allocation strategy for hittingRangeData and merged sources…
Mar 13, 2026
18a4ca6
refactor: segment lifecycle notification methods have been updated fo…
Mar 13, 2026
d438cc6
refactor: improve linked list node unlinking logic for thread safety …
Mar 13, 2026
ef178d8
refactor: code comments have been enhanced for clarity and consistenc…
Mar 13, 2026
59367d1
refactor: improve package creation error handling and logging for cla…
Mar 13, 2026
849d745
refactor: remove core project build and pack steps from CI workflows;…
Mar 13, 2026
3f3d67a
refactor: async methods have been updated to use BuildAsync for cache…
Mar 13, 2026
3679d31
refactor: code comments have been improved for clarity and consistenc…
Mar 13, 2026
b6449e1
docs: update diagnostics and glossary for VisitedPlaces cache; add ar…
Mar 14, 2026
d9f0055
docs: architecture documentation has been updated for clarity and acc…
Mar 14, 2026
7ac3f7a
docs: architecture documentation has been enhanced for clarity and de…
Mar 14, 2026
d934466
docs: agent guidelines have been updated for clarity and conciseness;…
Mar 14, 2026
4c3eb21
docs: infrastructure and architecture documentation have been updated…
Mar 14, 2026
3861237
feat: shared infrastructure for data generation has been introduced; …
Mar 14, 2026
38121b2
refactor: unused using directives have been removed from several file…
Mar 14, 2026
dee8472
refactor: eviction policy lifecycle has been clarified and improved f…
Mar 14, 2026
2508128
refactor: activity counter management has been improved for thread sa…
Mar 14, 2026
b1310d9
style: spacing in array spread syntax has been corrected
Mar 14, 2026
236d911
feat(benchmarks): performance benchmarks for caching mechanisms have …
Mar 15, 2026
74005c1
feat(storage): AddRange method has been introduced for bulk segment i…
Mar 15, 2026
2e4bdfe
feat(benchmarks): multiple gaps and single gap partial hit benchmarks…
Mar 15, 2026
76d0dc3
feat(cache): TTL expiration handling has been integrated into normali…
Mar 15, 2026
1915197
fix(cache): eviction logic has been corrected to ensure segments are …
Mar 15, 2026
a32586f
refactor(cache): CacheNormalizationExecutor has been simplified by re…
Mar 15, 2026
f604cb0
refactor(cache): expiration check logic has been streamlined to remov…
Mar 15, 2026
73be5af
refactor(storage): Add and AddRange methods have been replaced with T…
Mar 15, 2026
3c6a687
refactor(cache): segment removal logic has been updated to use TryRem…
Mar 15, 2026
0c6f37f
chore: benchmark tests for VPC have been planned; code formatting has…
Mar 15, 2026
dd508e8
docs: documentation has been updated to reflect TryRemove semantics a…
Mar 15, 2026
0c75c8d
docs: XML documentation has been streamlined for clarity and consiste…
Mar 15, 2026
c674498
refactor(cache): GetDataAndWaitForIdleAsync has been replaced with Ge…
Mar 15, 2026
c976dbb
feat(cache): FrozenDataSource and FrozenYieldingDataSource have been …
Mar 15, 2026
e75faef
feat(benchmarks): benchmark classes have been renamed for clarity and…
Mar 16, 2026
9f282c8
refactor(benchmarks): layout constants and factory methods have been …
Mar 16, 2026
07d59a9
chore: old project with benchmarks was removed
Mar 16, 2026
65eb97e
feat(benchmarks): new benchmark reports for layered and visited place…
Mar 16, 2026
13ece4e
Potential fix for pull request finding
blaze6950 Mar 16, 2026
e2eab3c
Potential fix for pull request finding
blaze6950 Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
154 changes: 108 additions & 46 deletions .github/test-ci-locally.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Local CI/CD Testing Script
# This script replicates the GitHub Actions workflow locally for testing
# This script replicates the GitHub Actions workflows locally for testing

Write-Host "========================================" -ForegroundColor Cyan
Write-Host "Intervals.NET.Caching CI/CD Local Test" -ForegroundColor Cyan
Expand All @@ -8,19 +8,28 @@ Write-Host ""

# Environment variables (matching GitHub Actions)
$env:SOLUTION_PATH = "Intervals.NET.Caching.sln"
$env:PROJECT_PATH = "src/Intervals.NET.Caching/Intervals.NET.Caching.csproj"
$env:WASM_VALIDATION_PATH = "src/Intervals.NET.Caching.WasmValidation/Intervals.NET.Caching.WasmValidation.csproj"
$env:UNIT_TEST_PATH = "tests/Intervals.NET.Caching.Unit.Tests/Intervals.NET.Caching.Unit.Tests.csproj"
$env:INTEGRATION_TEST_PATH = "tests/Intervals.NET.Caching.Integration.Tests/Intervals.NET.Caching.Integration.Tests.csproj"
$env:INVARIANTS_TEST_PATH = "tests/Intervals.NET.Caching.Invariants.Tests/Intervals.NET.Caching.Invariants.Tests.csproj"

# SlidingWindow
$env:SWC_PROJECT_PATH = "src/Intervals.NET.Caching.SlidingWindow/Intervals.NET.Caching.SlidingWindow.csproj"
$env:SWC_WASM_VALIDATION_PATH = "src/Intervals.NET.Caching.SlidingWindow.WasmValidation/Intervals.NET.Caching.SlidingWindow.WasmValidation.csproj"
$env:SWC_UNIT_TEST_PATH = "tests/Intervals.NET.Caching.SlidingWindow.Unit.Tests/Intervals.NET.Caching.SlidingWindow.Unit.Tests.csproj"
$env:SWC_INTEGRATION_TEST_PATH = "tests/Intervals.NET.Caching.SlidingWindow.Integration.Tests/Intervals.NET.Caching.SlidingWindow.Integration.Tests.csproj"
$env:SWC_INVARIANTS_TEST_PATH = "tests/Intervals.NET.Caching.SlidingWindow.Invariants.Tests/Intervals.NET.Caching.SlidingWindow.Invariants.Tests.csproj"

# VisitedPlaces
$env:VPC_PROJECT_PATH = "src/Intervals.NET.Caching.VisitedPlaces/Intervals.NET.Caching.VisitedPlaces.csproj"
$env:VPC_WASM_VALIDATION_PATH = "src/Intervals.NET.Caching.VisitedPlaces.WasmValidation/Intervals.NET.Caching.VisitedPlaces.WasmValidation.csproj"
$env:VPC_UNIT_TEST_PATH = "tests/Intervals.NET.Caching.VisitedPlaces.Unit.Tests/Intervals.NET.Caching.VisitedPlaces.Unit.Tests.csproj"
$env:VPC_INTEGRATION_TEST_PATH = "tests/Intervals.NET.Caching.VisitedPlaces.Integration.Tests/Intervals.NET.Caching.VisitedPlaces.Integration.Tests.csproj"
$env:VPC_INVARIANTS_TEST_PATH = "tests/Intervals.NET.Caching.VisitedPlaces.Invariants.Tests/Intervals.NET.Caching.VisitedPlaces.Invariants.Tests.csproj"

# Track failures
$failed = $false

# Step 1: Restore solution dependencies
Write-Host "[Step 1/9] Restoring solution dependencies..." -ForegroundColor Yellow
Write-Host "[Step 1/12] Restoring solution dependencies..." -ForegroundColor Yellow
dotnet restore $env:SOLUTION_PATH
if ($LASTEXITCODE -ne 0) {
if ($LASTEXITCODE -ne 0) {
Write-Host "? Restore failed" -ForegroundColor Red
$failed = $true
}
Expand All @@ -30,9 +39,9 @@ else {
Write-Host ""

# Step 2: Build solution
Write-Host "[Step 2/9] Building solution (Release)..." -ForegroundColor Yellow
Write-Host "[Step 2/12] Building solution (Release)..." -ForegroundColor Yellow
dotnet build $env:SOLUTION_PATH --configuration Release --no-restore
if ($LASTEXITCODE -ne 0) {
if ($LASTEXITCODE -ne 0) {
Write-Host "? Build failed" -ForegroundColor Red
$failed = $true
}
Expand All @@ -41,56 +50,104 @@ else {
}
Write-Host ""

# Step 3: Validate WebAssembly compatibility
Write-Host "[Step 3/9] Validating WebAssembly compatibility..." -ForegroundColor Yellow
dotnet build $env:WASM_VALIDATION_PATH --configuration Release --no-restore
if ($LASTEXITCODE -ne 0) {
Write-Host "? WebAssembly validation failed" -ForegroundColor Red
# Step 3: Validate SlidingWindow WebAssembly compatibility
Write-Host "[Step 3/12] Validating SlidingWindow WebAssembly compatibility..." -ForegroundColor Yellow
dotnet build $env:SWC_WASM_VALIDATION_PATH --configuration Release --no-restore
if ($LASTEXITCODE -ne 0) {
Write-Host "? SlidingWindow WebAssembly validation failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? SlidingWindow WebAssembly compilation successful - library is compatible with net8.0-browser" -ForegroundColor Green
}
Write-Host ""

# Step 4: Validate VisitedPlaces WebAssembly compatibility
Write-Host "[Step 4/12] Validating VisitedPlaces WebAssembly compatibility..." -ForegroundColor Yellow
dotnet build $env:VPC_WASM_VALIDATION_PATH --configuration Release --no-restore
if ($LASTEXITCODE -ne 0) {
Write-Host "? VisitedPlaces WebAssembly validation failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? WebAssembly compilation successful - library is compatible with net8.0-browser" -ForegroundColor Green
Write-Host "? VisitedPlaces WebAssembly compilation successful - library is compatible with net8.0-browser" -ForegroundColor Green
}
Write-Host ""

# Step 4: Run Unit Tests
Write-Host "[Step 4/9] Running Unit Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:UNIT_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/Unit
if ($LASTEXITCODE -ne 0) {
Write-Host "? Unit tests failed" -ForegroundColor Red
# Step 5: Run SlidingWindow Unit Tests
Write-Host "[Step 5/12] Running SlidingWindow Unit Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:SWC_UNIT_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/SWC/Unit
if ($LASTEXITCODE -ne 0) {
Write-Host "? SlidingWindow Unit tests failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? Unit tests passed" -ForegroundColor Green
Write-Host "? SlidingWindow Unit tests passed" -ForegroundColor Green
}
Write-Host ""

# Step 5: Run Integration Tests
Write-Host "[Step 5/9] Running Integration Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:INTEGRATION_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/Integration
if ($LASTEXITCODE -ne 0) {
Write-Host "? Integration tests failed" -ForegroundColor Red
# Step 6: Run SlidingWindow Integration Tests
Write-Host "[Step 6/12] Running SlidingWindow Integration Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:SWC_INTEGRATION_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/SWC/Integration
if ($LASTEXITCODE -ne 0) {
Write-Host "? SlidingWindow Integration tests failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? Integration tests passed" -ForegroundColor Green
Write-Host "? SlidingWindow Integration tests passed" -ForegroundColor Green
}
Write-Host ""

# Step 6: Run Invariants Tests
Write-Host "[Step 6/9] Running Invariants Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:INVARIANTS_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/Invariants
if ($LASTEXITCODE -ne 0) {
Write-Host "? Invariants tests failed" -ForegroundColor Red
# Step 7: Run SlidingWindow Invariants Tests
Write-Host "[Step 7/12] Running SlidingWindow Invariants Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:SWC_INVARIANTS_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/SWC/Invariants
if ($LASTEXITCODE -ne 0) {
Write-Host "? SlidingWindow Invariants tests failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? Invariants tests passed" -ForegroundColor Green
Write-Host "? SlidingWindow Invariants tests passed" -ForegroundColor Green
}
Write-Host ""

# Step 7: Check coverage files
Write-Host "[Step 7/9] Checking coverage files..." -ForegroundColor Yellow
# Step 8: Run VisitedPlaces Unit Tests
Write-Host "[Step 8/12] Running VisitedPlaces Unit Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:VPC_UNIT_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/VPC/Unit
if ($LASTEXITCODE -ne 0) {
Write-Host "? VisitedPlaces Unit tests failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? VisitedPlaces Unit tests passed" -ForegroundColor Green
}
Write-Host ""

# Step 9: Run VisitedPlaces Integration Tests
Write-Host "[Step 9/12] Running VisitedPlaces Integration Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:VPC_INTEGRATION_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/VPC/Integration
if ($LASTEXITCODE -ne 0) {
Write-Host "? VisitedPlaces Integration tests failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? VisitedPlaces Integration tests passed" -ForegroundColor Green
}
Write-Host ""

# Step 10: Run VisitedPlaces Invariants Tests
Write-Host "[Step 10/12] Running VisitedPlaces Invariants Tests with coverage..." -ForegroundColor Yellow
dotnet test $env:VPC_INVARIANTS_TEST_PATH --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/VPC/Invariants
if ($LASTEXITCODE -ne 0) {
Write-Host "? VisitedPlaces Invariants tests failed" -ForegroundColor Red
$failed = $true
}
else {
Write-Host "? VisitedPlaces Invariants tests passed" -ForegroundColor Green
}
Write-Host ""

# Step 11: Check coverage files
Write-Host "[Step 11/12] Checking coverage files..." -ForegroundColor Yellow
$coverageFiles = Get-ChildItem -Path "./TestResults" -Filter "coverage.cobertura.xml" -Recurse
if ($coverageFiles.Count -gt 0) {
Write-Host "? Found $($coverageFiles.Count) coverage file(s)" -ForegroundColor Green
Expand All @@ -103,26 +160,31 @@ else {
}
Write-Host ""

# Step 8: Build NuGet package
Write-Host "[Step 8/9] Creating NuGet package..." -ForegroundColor Yellow
# Step 12: Build NuGet packages
Write-Host "[Step 12/12] Creating NuGet packages..." -ForegroundColor Yellow
if (Test-Path "./artifacts") {
Remove-Item -Path "./artifacts" -Recurse -Force
}
dotnet pack $env:PROJECT_PATH --configuration Release --no-build --output ./artifacts
if ($LASTEXITCODE -ne 0) {
Write-Host "? Package creation failed" -ForegroundColor Red
dotnet pack $env:SWC_PROJECT_PATH --configuration Release --no-build --output ./artifacts
if ($LASTEXITCODE -ne 0) {
Write-Host "? Package creation failed (SlidingWindow)" -ForegroundColor Red
$failed = $true
}
else {
dotnet pack $env:VPC_PROJECT_PATH --configuration Release --no-build --output ./artifacts
if ($LASTEXITCODE -ne 0) {
Write-Host "? Package creation failed (VisitedPlaces)" -ForegroundColor Red
$failed = $true
}
if (-not $failed) {
$packages = Get-ChildItem -Path "./artifacts" -Filter "*.nupkg"
Write-Host "? Package created successfully" -ForegroundColor Green
Write-Host "? Packages created successfully" -ForegroundColor Green
foreach ($pkg in $packages) {
Write-Host " - $($pkg.Name)" -ForegroundColor Gray
}
}
Write-Host ""

# Step 9: Summary
# Summary
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "Test Summary" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Expand All @@ -135,7 +197,7 @@ else {
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Cyan
Write-Host " - Review coverage reports in ./TestResults/" -ForegroundColor Gray
Write-Host " - Inspect NuGet package in ./artifacts/" -ForegroundColor Gray
Write-Host " - Push to trigger GitHub Actions workflow" -ForegroundColor Gray
Write-Host " - Inspect NuGet packages in ./artifacts/" -ForegroundColor Gray
Write-Host " - Push to trigger GitHub Actions workflows" -ForegroundColor Gray
exit 0
}
Original file line number Diff line number Diff line change
@@ -1,67 +1,75 @@
name: CI/CD - Intervals.NET.Caching
name: CI/CD - Intervals.NET.Caching.SlidingWindow

on:
push:
branches: [ master, main ]
paths:
- 'src/Intervals.NET.Caching/**'
- 'src/Intervals.NET.Caching.WasmValidation/**'
- 'tests/**'
- '.github/workflows/Intervals.NET.Caching.yml'
- 'src/Intervals.NET.Caching.SlidingWindow/**'
- 'src/Intervals.NET.Caching.SlidingWindow.WasmValidation/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Unit.Tests/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Integration.Tests/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Invariants.Tests/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Tests.Infrastructure/**'
- '.github/workflows/intervals-net-caching-swc.yml'
pull_request:
branches: [ master, main ]
paths:
- 'src/Intervals.NET.Caching/**'
- 'src/Intervals.NET.Caching.WasmValidation/**'
- 'tests/**'
- '.github/workflows/Intervals.NET.Caching.yml'
- 'src/Intervals.NET.Caching.SlidingWindow/**'
- 'src/Intervals.NET.Caching.SlidingWindow.WasmValidation/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Unit.Tests/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Integration.Tests/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Invariants.Tests/**'
- 'tests/Intervals.NET.Caching.SlidingWindow.Tests.Infrastructure/**'
- '.github/workflows/intervals-net-caching-swc.yml'
workflow_dispatch:

env:
DOTNET_VERSION: '8.x.x'
SOLUTION_PATH: 'Intervals.NET.Caching.sln'
PROJECT_PATH: 'src/Intervals.NET.Caching/Intervals.NET.Caching.csproj'
WASM_VALIDATION_PATH: 'src/Intervals.NET.Caching.WasmValidation/Intervals.NET.Caching.WasmValidation.csproj'
UNIT_TEST_PATH: 'tests/Intervals.NET.Caching.Unit.Tests/Intervals.NET.Caching.Unit.Tests.csproj'
INTEGRATION_TEST_PATH: 'tests/Intervals.NET.Caching.Integration.Tests/Intervals.NET.Caching.Integration.Tests.csproj'
INVARIANTS_TEST_PATH: 'tests/Intervals.NET.Caching.Invariants.Tests/Intervals.NET.Caching.Invariants.Tests.csproj'
PROJECT_PATH: 'src/Intervals.NET.Caching.SlidingWindow/Intervals.NET.Caching.SlidingWindow.csproj'
WASM_VALIDATION_PATH: 'src/Intervals.NET.Caching.SlidingWindow.WasmValidation/Intervals.NET.Caching.SlidingWindow.WasmValidation.csproj'
UNIT_TEST_PATH: 'tests/Intervals.NET.Caching.SlidingWindow.Unit.Tests/Intervals.NET.Caching.SlidingWindow.Unit.Tests.csproj'
INTEGRATION_TEST_PATH: 'tests/Intervals.NET.Caching.SlidingWindow.Integration.Tests/Intervals.NET.Caching.SlidingWindow.Integration.Tests.csproj'
INVARIANTS_TEST_PATH: 'tests/Intervals.NET.Caching.SlidingWindow.Invariants.Tests/Intervals.NET.Caching.SlidingWindow.Invariants.Tests.csproj'

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

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore solution dependencies
run: dotnet restore ${{ env.SOLUTION_PATH }}

- name: Build solution
run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore

- name: Validate WebAssembly compatibility
run: |
echo "::group::WebAssembly Validation"
echo "Building Intervals.NET.Caching.WasmValidation for net8.0-browser target..."
echo "Building Intervals.NET.Caching.SlidingWindow.WasmValidation for net8.0-browser target..."
dotnet build ${{ env.WASM_VALIDATION_PATH }} --configuration Release --no-restore
echo "? WebAssembly compilation successful - library is compatible with net8.0-browser"
echo "WebAssembly compilation successful - library is compatible with net8.0-browser"
echo "::endgroup::"

- name: Run Unit Tests with coverage
run: dotnet test ${{ env.UNIT_TEST_PATH }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/Unit

- name: Run Integration Tests with coverage
run: dotnet test ${{ env.INTEGRATION_TEST_PATH }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/Integration

- name: Run Invariants Tests with coverage
run: dotnet test ${{ env.INVARIANTS_TEST_PATH }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/Invariants

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
Expand All @@ -76,30 +84,30 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-test
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Build Intervals.NET.Caching
run: dotnet restore ${{ env.SOLUTION_PATH }}

- name: Build Intervals.NET.Caching.SlidingWindow
run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release --no-restore
- name: Pack Intervals.NET.Caching

- name: Pack Intervals.NET.Caching.SlidingWindow
run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --no-build --output ./artifacts
- name: Publish Intervals.NET.Caching to NuGet
run: dotnet nuget push ./artifacts/Intervals.NET.Caching.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Publish packages to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: Intervals.NET.Caching-package
name: nuget-packages-swc
path: ./artifacts/*.nupkg
Loading
Loading