66 - main
77 - release-*
88 - v*
9- paths :
9+
1010 pull_request :
11- paths :
11+
1212 workflow_dispatch :
1313 inputs :
1414 full-matrix :
1919 required : false
2020 type : string
2121 description : " (Optional) Test run name"
22+
2223 schedule :
2324 - cron : " 0 3 * * *"
2425
@@ -30,8 +31,8 @@ concurrency:
3031 cancel-in-progress : true
3132
3233run-name :
33- # Set custom name if job is started manually and name is given
34- ${{ github.event_name == 'workflow_dispatch' && ( inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }}
34+ # Use a distinct name for full-matrix or scheduled runs; otherwise keep manual-dispatch naming behavior
35+ ${{ ( 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) ) || '' }}
3536
3637env :
3738 CARGO_TERM_COLOR : always
4445 host-matrix-output : ${{ steps.get-matrices.outputs.os-matrix-output }}
4546 version-matrix-output : ${{ steps.get-matrices.outputs.version-matrix-output }}
4647 steps :
48+ - name : Write inputs.json
49+ uses : actions/github-script@v7
50+ with :
51+ script : |
52+ const fs = require('fs');
53+ fs.mkdirSync('.run-meta', {recursive: true});
54+ const event = context.eventName;
55+ const out = {event};
56+ if (event === 'workflow_dispatch') {
57+ const inputs = context.payload.inputs || {};
58+ const raw = inputs['full-matrix'];
59+ const fm = (raw === true) || (String(raw).toLowerCase() === 'true');
60+ out.inputs = {
61+ 'full-matrix': fm,
62+ name: inputs.name || ''
63+ };
64+ }
65+ fs.writeFileSync('.run-meta/inputs.json', JSON.stringify(out));
66+ core.info(`inputs.json => ${JSON.stringify(out)}`);
67+
68+ - name : Upload inputs.json
69+ uses : actions/upload-artifact@v4
70+ with :
71+ name : inputs.json
72+ path : .run-meta/inputs.json
73+ if-no-files-found : error
74+
4775 - uses : actions/checkout@v5
4876 - id : get-matrices
4977 uses : ./.github/workflows/create-test-matrices
@@ -97,7 +125,35 @@ jobs:
97125 key : rust-${{ matrix.host.TARGET }}
98126
99127 - name : Test dotnet ${{ matrix.dotnet }}
100- run : dotnet test --configuration Debug --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "console;verbosity=detailed" --results-directory .
128+ 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 .
129+
130+ - name : Derive failures.json (from TRX)
131+ if : always()
132+ shell : bash
133+ run : |
134+ set -euo pipefail
135+ SUMMARY_FILE=failures.json
136+ if command -v xmllint >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
137+ FAILED_COUNT=$(xmllint --xpath "string(//Counters/@failed)" TestResults.trx 2>/dev/null || echo 0)
138+ PASSED_COUNT=$(xmllint --xpath "string(//Counters/@passed)" TestResults.trx 2>/dev/null || echo 0)
139+ TOTAL_COUNT=$(xmllint --xpath "string(//Counters/@total)" TestResults.trx 2>/dev/null || echo 0)
140+ SKIPPED_COUNT=$(xmllint --xpath "string(//Counters/@skipped)" TestResults.trx 2>/dev/null || echo 0)
141+ echo "{" > "$SUMMARY_FILE"
142+ echo " \"workflow\": \"C# tests\"," >> "$SUMMARY_FILE"
143+ echo " \"runId\": ${GITHUB_RUN_ID}," >> "$SUMMARY_FILE"
144+ echo " \"jobName\": \"net${{ matrix.dotnet }}, server ${{ matrix.server.version }}, ${{ matrix.host.TARGET }}\"," >> "$SUMMARY_FILE"
145+ echo " \"matrix\": {" >> "$SUMMARY_FILE"
146+ echo " \"dotnet\": \"${{ matrix.dotnet }}\"," >> "$SUMMARY_FILE"
147+ echo " \"server\": { \"type\": \"${{ matrix.server.type }}\", \"version\": \"${{ matrix.server.version }}\" }," >> "$SUMMARY_FILE"
148+ echo " \"host\": { \"OS\": \"${{ matrix.host.OS }}\", \"ARCH\": \"${{ matrix.host.ARCH }}\", \"RUNNER\": \"${{ matrix.host.RUNNER }}\" }" >> "$SUMMARY_FILE"
149+ echo " }," >> "$SUMMARY_FILE"
150+ echo " \"summary\": { \"total\": $TOTAL_COUNT, \"passed\": $PASSED_COUNT, \"failed\": $FAILED_COUNT, \"skipped\": $SKIPPED_COUNT }," >> "$SUMMARY_FILE"
151+ echo " \"failed\": []," >> "$SUMMARY_FILE"
152+ echo " \"links\": { \"runUrl\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" }" >> "$SUMMARY_FILE"
153+ echo "}" >> "$SUMMARY_FILE"
154+ else
155+ echo '{"workflow":"C# tests","summary":{"note":"Install xmllint+jq for rich failures"}}' > "$SUMMARY_FILE"
156+ fi
101157
102158 - name : Run benchmark
103159 if : ${{ contains(matrix.host.RUNNER, 'ubuntu') }}
@@ -107,6 +163,10 @@ jobs:
107163 redis-server --save "" --daemonize "yes"
108164 ./install_and_test.sh -no-tls -minimal -only-glide -data 1 -tasks 10 -csharp -dotnet-framework net${{ matrix.dotnet }}
109165
166+ - name : Run coverage
167+ if : ${{ matrix.dotnet == '8.0' && contains(matrix.host.RUNNER, 'ubuntu') && matrix.host.ARCH == 'x64' && matrix.server.version == '8.1' }}
168+ uses : ./.github/workflows/run-coverage
169+
110170 - name : Upload test reports
111171 if : always()
112172 continue-on-error : true
@@ -115,6 +175,8 @@ jobs:
115175 name : test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ matrix.host.OS }}-${{ matrix.host.ARCH }}
116176 path : |
117177 TestReport.html
178+ TestResults.trx
179+ failures.json
118180 valkey-glide/benchmarks/results/*
119181 valkey-glide/utils/clusters/**
120182
@@ -182,16 +244,46 @@ jobs:
182244 key : rust-${{ matrix.host.IMAGE }}
183245
184246 - name : Test dotnet ${{ matrix.dotnet }}
185- run : dotnet test --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "console;verbosity=detailed" --results-directory .
247+ run : dotnet test --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "trx;LogFileName=TestResults.trx" --logger "console;verbosity=detailed" --results-directory .
248+
249+ - name : Derive failures.json (from TRX)
250+ if : always()
251+ shell : bash
252+ run : |
253+ set -euo pipefail
254+ SUMMARY_FILE=failures.json
255+ if command -v xmllint >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
256+ FAILED_COUNT=$(xmllint --xpath "string(//Counters/@failed)" TestResults.trx 2>/dev/null || echo 0)
257+ PASSED_COUNT=$(xmllint --xpath "string(//Counters/@passed)" TestResults.trx 2>/dev/null || echo 0)
258+ TOTAL_COUNT=$(xmllint --xpath "string(//Counters/@total)" TestResults.trx 2>/dev/null || echo 0)
259+ SKIPPED_COUNT=$(xmllint --xpath "string(//Counters/@skipped)" TestResults.trx 2>/dev/null || echo 0)
260+ echo "{" > "$SUMMARY_FILE"
261+ echo " \"workflow\": \"C# tests\"," >> "$SUMMARY_FILE"
262+ echo " \"runId\": ${GITHUB_RUN_ID}," >> "$SUMMARY_FILE"
263+ echo " \"jobName\": \"net${{ matrix.dotnet }}, server ${{ matrix.server.version }}, ${{ matrix.host.TARGET }}\"," >> "$SUMMARY_FILE"
264+ echo " \"matrix\": {" >> "$SUMMARY_FILE"
265+ echo " \"dotnet\": \"${{ matrix.dotnet }}\"," >> "$SUMMARY_FILE"
266+ echo " \"server\": { \"type\": \"${{ matrix.server.type }}\", \"version\": \"${{ matrix.server.version }}\" }," >> "$SUMMARY_FILE"
267+ echo " \"host\": { \"OS\": \"${{ matrix.host.OS }}\", \"ARCH\": \"${{ matrix.host.ARCH }}\", \"RUNNER\": \"${{ matrix.host.RUNNER }}\" }" >> "$SUMMARY_FILE"
268+ echo " }," >> "$SUMMARY_FILE"
269+ echo " \"summary\": { \"total\": $TOTAL_COUNT, \"passed\": $PASSED_COUNT, \"failed\": $FAILED_COUNT, \"skipped\": $SKIPPED_COUNT }," >> "$SUMMARY_FILE"
270+ echo " \"failed\": []," >> "$SUMMARY_FILE"
271+ echo " \"links\": { \"runUrl\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" }" >> "$SUMMARY_FILE"
272+ echo "}" >> "$SUMMARY_FILE"
273+ else
274+ echo '{"workflow":"C# tests","summary":{"note":"Install xmllint+jq for rich failures"}}' > "$SUMMARY_FILE"
275+ fi
186276
187277 - name : Upload test reports
188278 if : always()
189279 continue-on-error : true
190280 uses : actions/upload-artifact@v4
191281 with :
192- name : test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ env .IMAGE }}-${{ matrix.host.ARCH }}
282+ name : test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ matrix.host .IMAGE }}-${{ matrix.host.ARCH }}
193283 path : |
194284 TestReport.html
285+ TestResults.trx
286+ failures.json
195287 valkey-glide/utils/clusters/**
196288
197289 lint :
0 commit comments