Skip to content
Open
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/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ updates:
day: "monday"
time: "09:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "StackExchange.Redis"
groups:
patch-updates:
update-types:
Expand Down
5 changes: 5 additions & 0 deletions .github/json_matrices/server-matrix.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"type": "valkey",
"version": "9.0",
"run": "always"
},
{
"type": "valkey",
"version": "8.1",
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/api-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: API Compatibility (Valkey.Glide vs StackExchange.Redis)

on:
pull_request:
branches: [main]
branches:
- main
- release-*
- v*
workflow_dispatch:
inputs:
ser_version:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
inputs:
version:
description: "The release version of GLIDE, formatted as *.*.* or *.*.*-rc*"
description: "The release version of GLIDE, formatted as v*.*.* or v*.*.*-rc*"
required: true
nuget_publish:
description: "Publish to NuGet"
Expand Down Expand Up @@ -54,12 +54,14 @@ jobs:
shell: bash
run: |
if ${{ github.event_name == 'workflow_dispatch' }}; then
R_VERSION="${{ env.INPUT_VERSION }}"
RAW_VERSION="${{ env.INPUT_VERSION }}"
else
R_VERSION=${{ github.ref_name }}
RAW_VERSION=${{ github.ref_name }}
fi
# Strip leading 'v' if present
R_VERSION="${RAW_VERSION#v}"
echo "RELEASE_VERSION=${R_VERSION}" >> $GITHUB_ENV
echo "Release version detected: $R_VERSION"
echo "Release version detected: $R_VERSION (raw: $RAW_VERSION)"
echo "RELEASE_VERSION=$R_VERSION" >> $GITHUB_OUTPUT
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
Expand Down
56 changes: 55 additions & 1 deletion .github/workflows/report-failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,65 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'failure' && (github.event.workflow_run.event == 'schedule' || github.event.workflow_run.event == 'workflow_dispatch') }}
runs-on: ubuntu-latest
steps:
- name: Download artifacts from triggering run
- name: Download inputs.json artifact (if present)
id: inputs
uses: dawidd6/action-download-artifact@v11
continue-on-error: true
with:
run_id: ${{ github.event.workflow_run.id }}
name: inputs.json
path: inputs_artifact

- name: Gate on full-matrix runs
id: gate
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
const {owner, repo} = context.repo;
const runId = context.payload.workflow_run.id;
const event = context.payload.workflow_run.event;
const { data: run } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId });
const title = run.display_title || run.name || '';
// Prefer inputs.json when workflow_dispatch
let should = false;
if (event === 'schedule') {
should = true;
} else if (event === 'workflow_dispatch') {
try {
const fs = require('fs');
const path = 'inputs_artifact/inputs.json';
if (fs.existsSync(path)) {
const data = JSON.parse(fs.readFileSync(path, 'utf8'));
const fm = !!(data.inputs && data.inputs['full-matrix']);
should = fm;
core.info(`Gate via inputs.json: full-matrix=${fm}`);
} else {
core.info('inputs.json not found; falling back to title gate');
should = title.startsWith('C# Matrix Tests');
}
} catch (e) {
core.warning(`Failed to read inputs.json: ${e}`);
should = title.startsWith('C# Matrix Tests');
}
}
core.info(`Trigger event: ${event}; run title: ${title}; should process: ${should}`);
return should;

- name: Download artifacts from triggering run
uses: dawidd6/action-download-artifact@v6
if: ${{ steps.gate.outputs.result == 'true' }}
with:
run_id: ${{ github.event.workflow_run.id }}
path: downloaded

- name: Aggregate failures
id: aggregate
shell: bash
<<<<<<< HEAD
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have some merge issues here. You should just pull over the full file from the 0.9 branch as it is the latest version. The main branch was there just for testing purposes, but the 0.9 branch is the correct version. This is a new file that I added in the 0.9 release, so it should have no changes in main that conflict.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I think I resolved this then it didn't get committed somehow. I'll do as you say and just use the full file from the 0.9 branch.

=======
if: ${{ steps.gate.outputs.result == 'true' }}
>>>>>>> 7cb74f2 (CI: Nightly matrix failure reporter (artifacts + workflow_run aggregator) (#74))
run: |
set -euo pipefail
sudo apt-get update -y >/dev/null 2>&1 || true
Expand Down Expand Up @@ -117,6 +167,10 @@ jobs:
- name: Find or create rolling failure issue
id: ensure_issue
uses: actions/github-script@v7
<<<<<<< HEAD
=======
if: ${{ steps.gate.outputs.result == 'true' }}
>>>>>>> 7cb74f2 (CI: Nightly matrix failure reporter (artifacts + workflow_run aggregator) (#74))
env:
SUMMARY_PATH: ${{ steps.aggregate.outputs.summary_path }}
with:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/run-coverage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Run Coverage"
description: "Run code coverage collection and upload artifacts"
outputs:
line-coverage:
description: "Line coverage percentage"
value: ${{ steps.extract-coverage.outputs.line-coverage }}
branch-coverage:
description: "Branch coverage percentage"
value: ${{ steps.extract-coverage.outputs.branch-coverage }}
runs:
using: "composite"
steps:
- name: Install Task
shell: bash
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin

- name: Install reportgenerator
shell: bash
run: |
dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.4.12

- name: Build and run coverage
shell: bash
run: |
task coverage FRAMEWORK=net8.0

- name: Extract coverage metrics
id: extract-coverage
shell: bash
run: |
if [ -f "reports/Summary.json" ]; then
LINE_COVERAGE=$(cat reports/Summary.json | jq -r '.summary.linecoverage')
BRANCH_COVERAGE=$(cat reports/Summary.json | jq -r '.summary.branchcoverage')
echo "line-coverage=${LINE_COVERAGE}" >> $GITHUB_OUTPUT
echo "branch-coverage=${BRANCH_COVERAGE}" >> $GITHUB_OUTPUT
echo "=== Coverage Summary ==="
echo "Line Coverage: ${LINE_COVERAGE}%"
echo "Branch Coverage: ${BRANCH_COVERAGE}%"
else
echo "No coverage summary found."
exit 1
fi

- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: reports/

- name: Upload coverage results artifact
uses: actions/upload-artifact@v4
with:
name: test-results
path: testresults/
106 changes: 99 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- main
- release-*
- v*
paths:

pull_request:
paths:

workflow_dispatch:
inputs:
full-matrix:
Expand All @@ -19,6 +19,7 @@ on:
required: false
type: string
description: "(Optional) Test run name"

schedule:
- cron: "0 3 * * *"

Expand All @@ -30,8 +31,8 @@ concurrency:
cancel-in-progress: true

run-name:
# Set custom name if job is started manually and name is given
${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }}
# Use a distinct name for full-matrix or scheduled runs; otherwise keep manual-dispatch naming behavior
${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs['full-matrix'] == 'true')) && 'C# Matrix Tests' || (github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name)) || '' }}

env:
CARGO_TERM_COLOR: always
Expand All @@ -44,6 +45,33 @@ jobs:
host-matrix-output: ${{ steps.get-matrices.outputs.os-matrix-output }}
version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }}
steps:
- name: Write inputs.json
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
fs.mkdirSync('.run-meta', {recursive: true});
const event = context.eventName;
const out = {event};
if (event === 'workflow_dispatch') {
const inputs = context.payload.inputs || {};
const raw = inputs['full-matrix'];
const fm = (raw === true) || (String(raw).toLowerCase() === 'true');
out.inputs = {
'full-matrix': fm,
name: inputs.name || ''
};
}
fs.writeFileSync('.run-meta/inputs.json', JSON.stringify(out));
core.info(`inputs.json => ${JSON.stringify(out)}`);

- name: Upload inputs.json
uses: actions/upload-artifact@v4
with:
name: inputs.json
path: .run-meta/inputs.json
if-no-files-found: error

- uses: actions/checkout@v5
- id: get-matrices
uses: ./.github/workflows/create-test-matrices
Expand Down Expand Up @@ -97,7 +125,35 @@ jobs:
key: rust-${{ matrix.host.TARGET }}

- name: Test dotnet ${{ matrix.dotnet }}
run: dotnet test --configuration Debug --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "console;verbosity=detailed" --results-directory .
run: dotnet test --configuration Debug --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "trx;LogFileName=TestResults.trx" --logger "console;verbosity=detailed" --results-directory .

- name: Derive failures.json (from TRX)
if: always()
shell: bash
run: |
set -euo pipefail
SUMMARY_FILE=failures.json
if command -v xmllint >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
FAILED_COUNT=$(xmllint --xpath "string(//Counters/@failed)" TestResults.trx 2>/dev/null || echo 0)
PASSED_COUNT=$(xmllint --xpath "string(//Counters/@passed)" TestResults.trx 2>/dev/null || echo 0)
TOTAL_COUNT=$(xmllint --xpath "string(//Counters/@total)" TestResults.trx 2>/dev/null || echo 0)
SKIPPED_COUNT=$(xmllint --xpath "string(//Counters/@skipped)" TestResults.trx 2>/dev/null || echo 0)
echo "{" > "$SUMMARY_FILE"
echo " \"workflow\": \"C# tests\"," >> "$SUMMARY_FILE"
echo " \"runId\": ${GITHUB_RUN_ID}," >> "$SUMMARY_FILE"
echo " \"jobName\": \"net${{ matrix.dotnet }}, server ${{ matrix.server.version }}, ${{ matrix.host.TARGET }}\"," >> "$SUMMARY_FILE"
echo " \"matrix\": {" >> "$SUMMARY_FILE"
echo " \"dotnet\": \"${{ matrix.dotnet }}\"," >> "$SUMMARY_FILE"
echo " \"server\": { \"type\": \"${{ matrix.server.type }}\", \"version\": \"${{ matrix.server.version }}\" }," >> "$SUMMARY_FILE"
echo " \"host\": { \"OS\": \"${{ matrix.host.OS }}\", \"ARCH\": \"${{ matrix.host.ARCH }}\", \"RUNNER\": \"${{ matrix.host.RUNNER }}\" }" >> "$SUMMARY_FILE"
echo " }," >> "$SUMMARY_FILE"
echo " \"summary\": { \"total\": $TOTAL_COUNT, \"passed\": $PASSED_COUNT, \"failed\": $FAILED_COUNT, \"skipped\": $SKIPPED_COUNT }," >> "$SUMMARY_FILE"
echo " \"failed\": []," >> "$SUMMARY_FILE"
echo " \"links\": { \"runUrl\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" }" >> "$SUMMARY_FILE"
echo "}" >> "$SUMMARY_FILE"
else
echo '{"workflow":"C# tests","summary":{"note":"Install xmllint+jq for rich failures"}}' > "$SUMMARY_FILE"
fi

- name: Run benchmark
if: ${{ contains(matrix.host.RUNNER, 'ubuntu') }}
Expand All @@ -107,6 +163,10 @@ jobs:
redis-server --save "" --daemonize "yes"
./install_and_test.sh -no-tls -minimal -only-glide -data 1 -tasks 10 -csharp -dotnet-framework net${{ matrix.dotnet }}

- name: Run coverage
if: ${{ matrix.dotnet == '8.0' && contains(matrix.host.RUNNER, 'ubuntu') && matrix.host.ARCH == 'x64' && matrix.server.version == '8.1' }}
uses: ./.github/workflows/run-coverage

- name: Upload test reports
if: always()
continue-on-error: true
Expand All @@ -115,6 +175,8 @@ jobs:
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ matrix.host.OS }}-${{ matrix.host.ARCH }}
path: |
TestReport.html
TestResults.trx
failures.json
valkey-glide/benchmarks/results/*
valkey-glide/utils/clusters/**

Expand Down Expand Up @@ -182,16 +244,46 @@ jobs:
key: rust-${{ matrix.host.IMAGE }}

- name: Test dotnet ${{ matrix.dotnet }}
run: dotnet test --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "console;verbosity=detailed" --results-directory .
run: dotnet test --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "trx;LogFileName=TestResults.trx" --logger "console;verbosity=detailed" --results-directory .

- name: Derive failures.json (from TRX)
if: always()
shell: bash
run: |
set -euo pipefail
SUMMARY_FILE=failures.json
if command -v xmllint >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
FAILED_COUNT=$(xmllint --xpath "string(//Counters/@failed)" TestResults.trx 2>/dev/null || echo 0)
PASSED_COUNT=$(xmllint --xpath "string(//Counters/@passed)" TestResults.trx 2>/dev/null || echo 0)
TOTAL_COUNT=$(xmllint --xpath "string(//Counters/@total)" TestResults.trx 2>/dev/null || echo 0)
SKIPPED_COUNT=$(xmllint --xpath "string(//Counters/@skipped)" TestResults.trx 2>/dev/null || echo 0)
echo "{" > "$SUMMARY_FILE"
echo " \"workflow\": \"C# tests\"," >> "$SUMMARY_FILE"
echo " \"runId\": ${GITHUB_RUN_ID}," >> "$SUMMARY_FILE"
echo " \"jobName\": \"net${{ matrix.dotnet }}, server ${{ matrix.server.version }}, ${{ matrix.host.TARGET }}\"," >> "$SUMMARY_FILE"
echo " \"matrix\": {" >> "$SUMMARY_FILE"
echo " \"dotnet\": \"${{ matrix.dotnet }}\"," >> "$SUMMARY_FILE"
echo " \"server\": { \"type\": \"${{ matrix.server.type }}\", \"version\": \"${{ matrix.server.version }}\" }," >> "$SUMMARY_FILE"
echo " \"host\": { \"OS\": \"${{ matrix.host.OS }}\", \"ARCH\": \"${{ matrix.host.ARCH }}\", \"RUNNER\": \"${{ matrix.host.RUNNER }}\" }" >> "$SUMMARY_FILE"
echo " }," >> "$SUMMARY_FILE"
echo " \"summary\": { \"total\": $TOTAL_COUNT, \"passed\": $PASSED_COUNT, \"failed\": $FAILED_COUNT, \"skipped\": $SKIPPED_COUNT }," >> "$SUMMARY_FILE"
echo " \"failed\": []," >> "$SUMMARY_FILE"
echo " \"links\": { \"runUrl\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" }" >> "$SUMMARY_FILE"
echo "}" >> "$SUMMARY_FILE"
else
echo '{"workflow":"C# tests","summary":{"note":"Install xmllint+jq for rich failures"}}' > "$SUMMARY_FILE"
fi

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ env.IMAGE }}-${{ matrix.host.ARCH }}
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ matrix.host.IMAGE }}-${{ matrix.host.ARCH }}
path: |
TestReport.html
TestResults.trx
failures.json
valkey-glide/utils/clusters/**

lint:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ x64/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# Code Coverage Reports
[Rr]eports/

*_i.c
*_p.c
*_i.h
Expand Down
Loading
Loading