Skip to content

docs: update invariant references in documentation for accuracy #66

docs: update invariant references in documentation for accuracy

docs: update invariant references in documentation for accuracy #66

name: CI/CD - SlidingWindowCache
on:
push:
branches: [ master, main ]
paths:
- 'src/SlidingWindowCache/**'
- 'src/SlidingWindowCache.WasmValidation/**'
- 'tests/**'
- '.github/workflows/slidingwindowcache.yml'
pull_request:
branches: [ master, main ]
paths:
- 'src/SlidingWindowCache/**'
- 'src/SlidingWindowCache.WasmValidation/**'
- 'tests/**'
- '.github/workflows/slidingwindowcache.yml'
workflow_dispatch:
env:
DOTNET_VERSION: '8.x.x'
SOLUTION_PATH: 'SlidingWindowCache.sln'
PROJECT_PATH: 'src/SlidingWindowCache/SlidingWindowCache.csproj'
WASM_VALIDATION_PATH: 'src/SlidingWindowCache.WasmValidation/SlidingWindowCache.WasmValidation.csproj'
UNIT_TEST_PATH: 'tests/SlidingWindowCache.Unit.Tests/SlidingWindowCache.Unit.Tests.csproj'
INTEGRATION_TEST_PATH: 'tests/SlidingWindowCache.Integration.Tests/SlidingWindowCache.Integration.Tests.csproj'
INVARIANTS_TEST_PATH: 'tests/SlidingWindowCache.Invariants.Tests/SlidingWindowCache.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 SlidingWindowCache.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 "::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:
files: ./TestResults/**/coverage.cobertura.xml
fail_ci_if_error: false
verbose: true
flags: unittests,integrationtests,invarianttests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
publish-nuget:
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 SlidingWindowCache
run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release --no-restore
- name: Pack SlidingWindowCache
run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --no-build --output ./artifacts
- name: Publish SlidingWindowCache to NuGet
run: dotnet nuget push ./artifacts/SlidingWindowCache.*.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: slidingwindowcache-package
path: ./artifacts/*.nupkg