Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
paths-ignore:
- "examples/**"
9 changes: 9 additions & 0 deletions .github/dependabot-deps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "dependabot-management-workflow",
"version": "1.0.0",
"description": "Dependencies for the dependabot management workflow",
"dependencies": {
"@octokit/rest": "20.0.2",
"semver": "7.5.4"
}
}
41 changes: 41 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2

updates:
# Enable version updates for NuGet (C#)
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 10
groups:
patch-updates:
update-types:
- "patch"
minor-updates:
update-types:
- "minor"
labels:
- "dependencies"
- "nuget"
- "csharp"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
groups:
patch-updates:
update-types:
- "patch"
minor-updates:
update-types:
- "minor"
labels:
- "dependencies"
- "github-actions"
39 changes: 39 additions & 0 deletions .github/json_matrices/os-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[
{
"OS": "ubuntu",
"NAMED_OS": "linux",
"RUNNER": "ubuntu-24.04",
"ARCH": "x64",
"TARGET": "x86_64-unknown-linux-gnu",
"run": "always"
},
{
"OS": "ubuntu",
"NAMED_OS": "linux",
"RUNNER": "ubuntu-24.04-arm",
"ARCH": "arm64",
"TARGET": "aarch64-unknown-linux-gnu"
},
{
"OS": "macos",
"NAMED_OS": "darwin",
"RUNNER": "macos-15",
"ARCH": "arm64",
"TARGET": "aarch64-apple-darwin"
},
{
"OS": "macos",
"NAMED_OS": "darwin",
"RUNNER": "macos-13",
"ARCH": "x64",
"TARGET": "x86_64-apple-darwin"
},
{
"OS": "amazon-linux",
"NAMED_OS": "linux",
"RUNNER": "ubuntu-latest",
"ARCH": "x64",
"TARGET": "x86_64-unknown-linux-gnu",
"IMAGE": "amazonlinux:latest"
}
]
24 changes: 24 additions & 0 deletions .github/json_matrices/server-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"type": "valkey",
"version": "8.1",
"run": "always"
},
{
"type": "valkey",
"version": "8.0"
},
{
"type": "valkey",
"version": "7.2"
},
{
"type": "redis",
"version": "7.0"
},
{
"type": "redis",
"version": "6.2",
"run": "always"
}
]
4 changes: 4 additions & 0 deletions .github/json_matrices/version-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"versions": ["8.0", "6.0"],
"always-run-versions": ["8.0"]
}
55 changes: 55 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "CodeQL"

on:
push:
branches:
- "main"
- "v.?[0-9]+.[0-9]+.[0-9]+"
- "v.?[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+"
- release-*
pull_request:
branches:
- "main"
- "v.?[0-9]+.[0-9]+.[0-9]+"
- "v.?[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+"
- release-*
schedule:
- cron: "37 18 * * 6"
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: csharp
build-mode: manual

# C# Build
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"

- name: Build the client
shell: bash
run: dotnet build sources/Valkey.Glide/Valkey.Glide.csproj --configuration Lint --framework net8.0

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:csharp"
98 changes: 98 additions & 0 deletions .github/workflows/create-test-matrices/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
inputs:
run-full-matrix:
description: "Run the full matrix"
required: true
type: boolean
containers:
description: "Run in containers"
required: true
default: false
type: boolean

outputs:
server-matrix-output:
description: "Server matrix"
value: ${{ steps.load-server-matrix.outputs.server-matrix }}
os-matrix-output:
description: "OS matrix"
value: ${{ steps.load-os-matrix.outputs.os-matrix }}
version-matrix-output:
description: "Version matrix"
value: ${{ steps.create-lang-version-matrix.outputs.version-matrix }}

runs:
using: "composite"
steps:
- name: "Setup Environment Variables"
shell: bash
env:
RUN_FULL_MATRIX: ${{ inputs.run-full-matrix }}
CONTAINERS: ${{ inputs.containers }}
run: |
echo "RUN_FULL_MATRIX=$RUN_FULL_MATRIX" >> $GITHUB_ENV
echo "CONTAINERS=$CONTAINERS" >> $GITHUB_ENV

- name: Load server matrix
id: load-server-matrix
shell: bash
working-directory: .github/json_matrices
run: |
set -o pipefail
echo 'Select server versions to run tests against'
if [[ "$RUN_FULL_MATRIX" == "true" ]]; then
echo 'Pick all server versions - on cron (schedule) or if manually triggered job requires a full matrix'
jq -c . < server-matrix.json | awk '{ printf "server-matrix=%s\n", $0 }' | tee -a $GITHUB_OUTPUT
else
echo 'Pick server versions marked as `"run": "always"` only - on PR, push or manually triggered job which does not require full matrix'
jq -c '[.[] | select(.run == "always")]' < server-matrix.json | awk '{ printf "server-matrix=%s\n", $0 }' | tee -a $GITHUB_OUTPUT
fi

- name: Load os matrix
id: load-os-matrix
shell: bash
working-directory: .github/json_matrices
run: |
set -o pipefail
[[ "$CONTAINERS" == "true" ]] && CONDITION=".IMAGE?" || CONDITION=".IMAGE == null"
echo 'Select runners (VMs) to run tests on'
if [[ "$RUN_FULL_MATRIX" == "true" ]]; then
echo 'Pick all runners - on cron (schedule) or if manually triggered job requires a full matrix'
jq -c "[.[] | select($CONDITION)]" < os-matrix.json | awk '{ printf "os-matrix=%s\n", $0 }' | tee -a $GITHUB_OUTPUT
else
echo 'Pick runners marked as '"run": "always"' only - on PR, push or manually triggered job which does not require full matrix'
jq -c '[.[] | select(.run == "always")]' < os-matrix.json | awk '{ printf "os-matrix=%s\n", $0 }' | tee -a $GITHUB_OUTPUT
fi

- name: Create language version matrix
id: create-lang-version-matrix
shell: bash
working-directory: .github/json_matrices
run: |
set -o pipefail
echo 'Select language (framework/SDK) versions to run tests on'
if [[ "$RUN_FULL_MATRIX" == "true" ]]; then
echo 'Pick language versions listed in 'versions' - on cron (schedule) or if manually triggered job requires a full matrix'
jq -c ".versions" < version-matrix.json | awk '{ printf "version-matrix=%s\n", $0 }' | tee -a $GITHUB_OUTPUT
else
echo 'Pick language versions listed in 'always-run-versions' only - on PR, push or manually triggered job which does not require full matrix'
jq -c ".\"always-run-versions\"" < version-matrix.json | awk '{ printf "version-matrix=%s\n", $0 }' | tee -a $GITHUB_OUTPUT
fi

- name: Validate no empty/incorrect matrices
shell: bash
run: |
SERVERS=`jq length <<< '${{ steps.load-server-matrix.outputs.server-matrix }}'`
if [[ $SERVERS == 0 ]]; then
echo "Server version matrix is empty!"
exit 1
fi
HOSTS=`jq length <<< '${{ steps.load-os-matrix.outputs.os-matrix }}'`
if [[ $HOSTS == 0 ]]; then
echo "OS matrix is empty!"
exit 1
fi
LANGS=`jq length <<< '${{ steps.create-lang-version-matrix.outputs.version-matrix }}'`
if [[ $LANGS == 0 ]]; then
echo "Dotnet version matrix is empty!"
exit 1
fi
19 changes: 19 additions & 0 deletions .github/workflows/install-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Install Rust tool chain

inputs:
target:
description: "Specified target for rust toolchain, ex. x86_64-apple-darwin"
type: string
required: false
github-token:
description: "GitHub token"
type: string
required: true

runs:
using: "composite"
steps:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ inputs.target }}
Loading