From b99efba312cb2dfec1651de748258a77365ab835 Mon Sep 17 00:00:00 2001 From: Meir Blachman Date: Wed, 23 Jul 2025 21:36:21 +0300 Subject: [PATCH 1/2] chore: Adds macOS CI pipeline to GitHub Actions workflow Extends continuous integration coverage by adding a dedicated macOS job that mirrors the existing Windows and Linux test environments. Installs Redis via Homebrew and configures multiple .NET versions (6.0, 8.0, 9.0) to ensure cross-platform compatibility and comprehensive test coverage across different operating systems. --- .github/workflows/CI.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1796710a7..d21640dc9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -143,3 +143,41 @@ jobs: name: Tests Results - Windows Server 2022 path: 'test-results/*.trx' reporter: dotnet-trx + + macos: + name: StackExchange.Redis (macOS) + runs-on: macos-latest + env: + DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: "1" # Enable color output, even though the console output is redirected in Actions + TERM: xterm # Enable color output in GitHub Actions + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch the full history + - name: Install Redis + run: | + brew install redis + brew services start redis + # Wait for Redis to start + sleep 3 + # Verify Redis is running + redis-cli ping + - name: Install .NET SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 8.0.x + 9.0.x + - name: .NET Build + run: dotnet build Build.csproj -c Release /p:CI=true + - name: StackExchange.Redis.Tests + run: dotnet test tests/StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj -c Release --logger trx --logger GitHubActions --results-directory ./test-results/ /p:CI=true + - uses: dorny/test-reporter@v1 + continue-on-error: true + if: success() || failure() + with: + name: Test Results - macOS + path: 'test-results/*.trx' + reporter: dotnet-trx From afabef0bdaf5e71fee843820616088b3c8f710d1 Mon Sep 17 00:00:00 2001 From: Meir Blachman Date: Wed, 23 Jul 2025 22:20:17 +0300 Subject: [PATCH 2/2] Replaces Redis brew installation with docker compose Switches from installing Redis via Homebrew to using docker compose for better consistency and isolation in CI environment. Removes manual Redis service management and verification steps in favor of docker compose's built-in wait functionality. --- .github/workflows/CI.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d21640dc9..f6a24bcaf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -155,14 +155,9 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch the full history - - name: Install Redis - run: | - brew install redis - brew services start redis - # Wait for Redis to start - sleep 3 - # Verify Redis is running - redis-cli ping + - name: Start Redis Services (docker-compose) + working-directory: ./tests/RedisConfigs + run: docker compose -f docker-compose.yml up -d --wait - name: Install .NET SDK uses: actions/setup-dotnet@v3 with: