From f8d9dd816e972ceba0135acb606b336680787d75 Mon Sep 17 00:00:00 2001 From: suleman Date: Tue, 22 Sep 2026 14:44:03 +0500 Subject: [PATCH] add build pipeline --- .github/workflows/build.yml | 117 ++++++++++++++++++++++++++++++++++++ README.md | 2 + 2 files changed, 119 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..14b6afd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,117 @@ +name: Build + +on: + pull_request: + branches: [main] + push: + branches: [main] + workflow_dispatch: + +# A new push to the same PR/branch cancels the run that is still in progress. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: ${{ matrix.name }} + runs-on: windows-latest + strategy: + # Keep building the remaining integrations when one of them fails, + # so a single PR run reports every broken integration at once. + fail-fast: false + matrix: + include: + # --- SDK-style projects (dotnet build) ------------------------------- + - name: AspNetCore.DataProtection + solution: AspNetCore.DataProtection/DataProtection/NCache.OSS.AspNetCore.DataProtection.sln + - name: AspNetCore.DataProtection (Sample) + solution: AspNetCore.DataProtection/Sample/NCacheDataProtectionSample.slnx + - name: AspNetCore.OutputCacheProvider + solution: AspNetCore.OutputCacheProvider/NCacheOutputCacheProvider.sln + - name: AspNetCore.SignalR + solution: AspNetCore.SignalR/AspNetCore.SignalR.sln + - name: CacheManager.Core + solution: CacheManager.Core/CacheManager.sln + - name: EntityFrameworkCore + solution: EntityFrameworkCore/EntityFrameworkCoreCaching.sln + - name: EntityFrameworkCore 6+ + solution: EntityFrameworkCore/EntityFrameworkCore6Caching.sln + - name: Extensions + solution: Extensions/Alachisoft.NCache.Client.Extension.sln + - name: FusionCache + solution: FusionCache/NCache.ZiggyCreatures.FusionCache.Backplane/NCache.ZiggyCreatures.FusionCache.Backplane.sln + - name: FusionCache (Sample) + solution: FusionCache/Sample/NCache.FusionCache.Sample.slnx + - name: Microsoft.Extensions.Caching.Distributed (.NET) + solution: Microsoft.Extensions.Caching.Distributed/NCacheDistributedCache.Net.sln + - name: NCache.OSS.DistributedLock + solution: NCache.OSS.DistributedLock/DistributedLock.NCache.slnx + - name: NCache.OSS.HangFire + solution: NCache.OSS.HangFire/NCache.OSS.HangFire.slnx + - name: NCacheRateLimiting + solution: NCacheRateLimiting/NCacheRateLimiting.sln + - name: NHibernate + solution: NHibernate/NHibernateNCache.Net.sln + - name: SessionState (.NET) + solution: SessionState/SessionState.NetCore.sln + - name: TicketStore + solution: TicketStore/TicketStoreNCache.sln + + # --- Legacy .NET Framework projects (MSBuild + packages.config) ------- + - name: AspNet.OutputCacheProvider + solution: AspNet.OutputCacheProvider/Alachisoft.NCache.OutputCacheProvider.sln + msbuild: true + - name: AspNet.SignalR + solution: AspNet.SignalR/SIgnalR.NCache.sln + msbuild: true + - name: Microsoft.Extensions.Caching.Distributed (.NET Framework) + solution: Microsoft.Extensions.Caching.Distributed/NCacheDistributedCache.sln + msbuild: true + - name: SessionState (.NET Framework) + solution: SessionState/SessionState.4x.Framework.sln + msbuild: true + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + if: ${{ !matrix.msbuild }} + uses: actions/setup-dotnet@v4 + with: + # 9.x is needed for .slnx solutions and the net9.0 sample; net6.0/netcoreapp3.1 + # targets only need their reference packs, which restore pulls from NuGet. + dotnet-version: | + 8.0.x + 9.0.x + + - name: Build (dotnet) + if: ${{ !matrix.msbuild }} + run: dotnet build "${{ matrix.solution }}" --configuration Release + + - name: Setup MSBuild + if: ${{ matrix.msbuild }} + uses: microsoft/setup-msbuild@v2 + + - name: Build (MSBuild) + if: ${{ matrix.msbuild }} + run: msbuild "${{ matrix.solution }}" -restore -p:RestorePackagesConfig=true -p:Configuration=Release + + # Single status check that branch protection can require. It fails if any + # integration in the matrix failed, so a PR can't be merged with a broken build. + build-summary: + name: Build summary + runs-on: ubuntu-latest + needs: build + if: always() + steps: + - name: Check matrix result + run: | + echo "Build result: ${{ needs.build.result }}" + if [ "${{ needs.build.result }}" != "success" ]; then + exit 1 + fi diff --git a/README.md b/README.md index 549b6ce..b78b99c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # NCache Integrations for .NET +[![Build](https://github.com/Alachisoft/NCache-Integrations/actions/workflows/build.yml/badge.svg)](https://github.com/Alachisoft/NCache-Integrations/actions/workflows/build.yml) + NCache Integrations provides open-source integrations that enable .NET and ASP.NET applications to use [NCache](https://www.alachisoft.com/ncache/) for distributed caching, application-state management, output caching, real-time messaging, and other scalability requirements. These integrations help applications share cached data and application state across multiple servers in web farms, containerized environments, and cloud deployments.