Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
244 changes: 122 additions & 122 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ jobs:
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: 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:
dotnet-version: |
6.0.x
8.0.x
10.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 - Ubuntu
path: 'test-results/*.trx'
reporter: dotnet-trx
- name: .NET Lib Pack
run: dotnet pack src/StackExchange.Redis/StackExchange.Redis.csproj --no-build -c Release /p:Packing=true /p:PackageOutputPath=%CD%\.nupkgs /p:CI=true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch the full history
- 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@v4
with:
dotnet-version: |
6.0.x
8.0.x
10.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 - Ubuntu
path: 'test-results/*.trx'
reporter: dotnet-trx
- name: .NET Lib Pack
run: dotnet pack src/StackExchange.Redis/StackExchange.Redis.csproj --no-build -c Release /p:Packing=true /p:PackageOutputPath=%CD%\.nupkgs /p:CI=true

windows:
name: StackExchange.Redis (Windows Server 2022)
Expand All @@ -54,99 +54,99 @@ jobs:
TERM: xterm
DOCKER_BUILDKIT: 1
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch the full history
- uses: Vampire/setup-wsl@v2
with:
distribution: Ubuntu-22.04
- name: Install Redis
shell: wsl-bash {0}
working-directory: ./tests/RedisConfigs
run: |
apt-get update
apt-get install curl gpg lsb-release libgomp1 jq -y
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install -y redis
mkdir redis
- name: Run redis-server
shell: wsl-bash {0}
working-directory: ./tests/RedisConfigs/redis
run: |
pwd
ls .
# Run each server instance in order
redis-server ../Basic/primary-6379.conf &
redis-server ../Basic/replica-6380.conf &
redis-server ../Basic/secure-6381.conf &
redis-server ../Failover/primary-6382.conf &
redis-server ../Failover/replica-6383.conf &
redis-server ../Cluster/cluster-7000.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7001.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7002.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7003.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7004.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7005.conf --dir ../Cluster &
redis-server ../Sentinel/redis-7010.conf &
redis-server ../Sentinel/redis-7011.conf &
redis-server ../Sentinel/sentinel-26379.conf --sentinel &
redis-server ../Sentinel/sentinel-26380.conf --sentinel &
redis-server ../Sentinel/sentinel-26381.conf --sentinel &
# Wait for server instances to get ready
sleep 5
echo "Checking redis-server version with port 6379"
redis-cli -p 6379 INFO SERVER | grep redis_version || echo "Failed to get version for port 6379"
echo "Checking redis-server version with port 6380"
redis-cli -p 6380 INFO SERVER | grep redis_version || echo "Failed to get version for port 6380"
echo "Checking redis-server version with port 6381"
redis-cli -p 6381 INFO SERVER | grep redis_version || echo "Failed to get version for port 6381"
echo "Checking redis-server version with port 6382"
redis-cli -p 6382 INFO SERVER | grep redis_version || echo "Failed to get version for port 6382"
echo "Checking redis-server version with port 6383"
redis-cli -p 6383 INFO SERVER | grep redis_version || echo "Failed to get version for port 6383"
echo "Checking redis-server version with port 7000"
redis-cli -p 7000 INFO SERVER | grep redis_version || echo "Failed to get version for port 7000"
echo "Checking redis-server version with port 7001"
redis-cli -p 7001 INFO SERVER | grep redis_version || echo "Failed to get version for port 7001"
echo "Checking redis-server version with port 7002"
redis-cli -p 7002 INFO SERVER | grep redis_version || echo "Failed to get version for port 7002"
echo "Checking redis-server version with port 7003"
redis-cli -p 7003 INFO SERVER | grep redis_version || echo "Failed to get version for port 7003"
echo "Checking redis-server version with port 7004"
redis-cli -p 7004 INFO SERVER | grep redis_version || echo "Failed to get version for port 7004"
echo "Checking redis-server version with port 7005"
redis-cli -p 7005 INFO SERVER | grep redis_version || echo "Failed to get version for port 7005"
echo "Checking redis-server version with port 7010"
redis-cli -p 7010 INFO SERVER | grep redis_version || echo "Failed to get version for port 7010"
echo "Checking redis-server version with port 7011"
redis-cli -p 7011 INFO SERVER | grep redis_version || echo "Failed to get version for port 7011"
echo "Checking redis-server version with port 26379"
redis-cli -p 26379 INFO SERVER | grep redis_version || echo "Failed to get version for port 26379"
echo "Checking redis-server version with port 26380"
redis-cli -p 26380 INFO SERVER | grep redis_version || echo "Failed to get version for port 26380"
echo "Checking redis-server version with port 26381"
redis-cli -p 26381 INFO SERVER | grep redis_version || echo "Failed to get version for port 26381"
continue-on-error: true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch the full history
- uses: Vampire/setup-wsl@v2
with:
distribution: Ubuntu-22.04
- name: Install Redis
shell: wsl-bash {0}
working-directory: ./tests/RedisConfigs
run: |
apt-get update
apt-get install curl gpg lsb-release libgomp1 jq -y
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install -y redis
mkdir redis
- name: Run redis-server
shell: wsl-bash {0}
working-directory: ./tests/RedisConfigs/redis
run: |
pwd
ls .
# Run each server instance in order
redis-server ../Basic/primary-6379.conf &
redis-server ../Basic/replica-6380.conf &
redis-server ../Basic/secure-6381.conf &
redis-server ../Failover/primary-6382.conf &
redis-server ../Failover/replica-6383.conf &
redis-server ../Cluster/cluster-7000.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7001.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7002.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7003.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7004.conf --dir ../Cluster &
redis-server ../Cluster/cluster-7005.conf --dir ../Cluster &
redis-server ../Sentinel/redis-7010.conf &
redis-server ../Sentinel/redis-7011.conf &
redis-server ../Sentinel/sentinel-26379.conf --sentinel &
redis-server ../Sentinel/sentinel-26380.conf --sentinel &
redis-server ../Sentinel/sentinel-26381.conf --sentinel &
# Wait for server instances to get ready
sleep 5
echo "Checking redis-server version with port 6379"
redis-cli -p 6379 INFO SERVER | grep redis_version || echo "Failed to get version for port 6379"
echo "Checking redis-server version with port 6380"
redis-cli -p 6380 INFO SERVER | grep redis_version || echo "Failed to get version for port 6380"
echo "Checking redis-server version with port 6381"
redis-cli -p 6381 INFO SERVER | grep redis_version || echo "Failed to get version for port 6381"
echo "Checking redis-server version with port 6382"
redis-cli -p 6382 INFO SERVER | grep redis_version || echo "Failed to get version for port 6382"
echo "Checking redis-server version with port 6383"
redis-cli -p 6383 INFO SERVER | grep redis_version || echo "Failed to get version for port 6383"
echo "Checking redis-server version with port 7000"
redis-cli -p 7000 INFO SERVER | grep redis_version || echo "Failed to get version for port 7000"
echo "Checking redis-server version with port 7001"
redis-cli -p 7001 INFO SERVER | grep redis_version || echo "Failed to get version for port 7001"
echo "Checking redis-server version with port 7002"
redis-cli -p 7002 INFO SERVER | grep redis_version || echo "Failed to get version for port 7002"
echo "Checking redis-server version with port 7003"
redis-cli -p 7003 INFO SERVER | grep redis_version || echo "Failed to get version for port 7003"
echo "Checking redis-server version with port 7004"
redis-cli -p 7004 INFO SERVER | grep redis_version || echo "Failed to get version for port 7004"
echo "Checking redis-server version with port 7005"
redis-cli -p 7005 INFO SERVER | grep redis_version || echo "Failed to get version for port 7005"
echo "Checking redis-server version with port 7010"
redis-cli -p 7010 INFO SERVER | grep redis_version || echo "Failed to get version for port 7010"
echo "Checking redis-server version with port 7011"
redis-cli -p 7011 INFO SERVER | grep redis_version || echo "Failed to get version for port 7011"
echo "Checking redis-server version with port 26379"
redis-cli -p 26379 INFO SERVER | grep redis_version || echo "Failed to get version for port 26379"
echo "Checking redis-server version with port 26380"
redis-cli -p 26380 INFO SERVER | grep redis_version || echo "Failed to get version for port 26380"
echo "Checking redis-server version with port 26381"
redis-cli -p 26381 INFO SERVER | grep redis_version || echo "Failed to get version for port 26381"
continue-on-error: true

- 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: Tests Results - Windows Server 2022
path: 'test-results/*.trx'
reporter: dotnet-trx
# Package and upload to MyGet only on pushes to main, not on PRs
- name: .NET Pack
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
run: dotnet pack Build.csproj --no-build -c Release /p:PackageOutputPath=${env:GITHUB_WORKSPACE}\.nupkgs /p:CI=true
- name: Upload to MyGet
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
run: dotnet nuget push ${env:GITHUB_WORKSPACE}\.nupkgs\*.nupkg -s https://www.myget.org/F/stackoverflow/api/v2/package -k ${{ secrets.MYGET_API_KEY }}
- 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: Tests Results - Windows Server 2022
path: 'test-results/*.trx'
reporter: dotnet-trx
# Package and upload to MyGet only on pushes to main, not on PRs
- name: .NET Pack
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
run: dotnet pack Build.csproj --no-build -c Release /p:PackageOutputPath=${env:GITHUB_WORKSPACE}\.nupkgs /p:CI=true
- name: Upload to MyGet
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
run: dotnet nuget push ${env:GITHUB_WORKSPACE}\.nupkgs\*.nupkg -s https://www.myget.org/F/stackoverflow/api/v2/package -k ${{ secrets.MYGET_API_KEY }}
63 changes: 32 additions & 31 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
# The branches below must be a subset of the branches above
branches: [ 'main' ]
workflow_dispatch:

schedule:
- cron: '8 9 * * 1'

Expand All @@ -30,33 +30,34 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- if: matrix.language == 'csharp'
name: .NET Build
run: dotnet build Build.csproj -c Release /p:CI=true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
10.0.x
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- if: matrix.language == 'csharp'
name: .NET Build
run: dotnet build Build.csproj -c Release /p:CI=true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
1 change: 1 addition & 0 deletions Build.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.Build.Traversal/3.0.2">
<ItemGroup>
<ProjectReference Include="eng\**\*.csproj" />
<ProjectReference Include="src\**\*.csproj" />
<ProjectReference Include="tests\**\*.csproj" />
<ProjectReference Include="toys\**\*.csproj" />
Expand Down
8 changes: 7 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)Shared.ruleset</CodeAnalysisRuleset>
<MSBuildWarningsAsMessages>NETSDK1069</MSBuildWarningsAsMessages>
<NoWarn>$(NoWarn);NU5105;NU1507;SER001;SER002;SER003</NoWarn>
<NoWarn>$(NoWarn);NU5105;NU1507;SER001;SER002;SER003;SER004;SER005</NoWarn>
<PackageReleaseNotes>https://stackexchange.github.io/StackExchange.Redis/ReleaseNotes</PackageReleaseNotes>
<PackageProjectUrl>https://stackexchange.github.io/StackExchange.Redis/</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down Expand Up @@ -42,4 +42,10 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(MSBuildProjectName)' != 'Build' and '$(MSBuildProjectName)' != 'StackExchange.Redis.Build'">
<!-- for everything except the build-tools project itself and the Build.csproj wrapper: use the build project as an analyzer -->
<ProjectReference Include="..\..\eng\StackExchange.Redis.Build\StackExchange.Redis.Build.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<PackageVersion Include="System.IO.Compression" Version="4.3.0" />
<!-- note that this bumps System.Buffers, so is pinned in down-level in SE csproj -->
<PackageVersion Include="System.IO.Hashing" Version="10.0.2" />
<!-- for RESPite -->
<PackageVersion Include="System.Buffers" Version="4.6.1" />
<PackageVersion Include="System.Memory" Version="4.6.1" />

<!-- For analyzers, tied to the consumer's build SDK; at the moment, that means "us" -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
Expand Down
Loading
Loading