Skip to content

Commit 8c1d83e

Browse files
authored
fix(scripts): dont fail on empty benchamrk (#3573)
1 parent e74a1bd commit 8c1d83e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/check.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,10 @@ jobs:
492492
- name: Read benchmark results
493493
id: benchmark
494494
run: |
495+
if [[ $(find tests/output -name benchmarkResult.json | wc -l) -eq 0 ]]; then
496+
echo "No benchmark results found"
497+
exit 0
498+
fi
495499
# merge all benchmark results into a single json, and remove the files
496500
results=$(jq -s 'add' -c tests/output/**/benchmarkResult.json)
497501
{
@@ -501,8 +505,8 @@ jobs:
501505
echo "" # empty line is required to make the table work
502506
echo "Benchmarks performed on the `search` method using a mock server, the results might not reflect the real-world performance."
503507
# format the json to a markdown table with column "Language" and "rate"
504-
echo "| Language | Rate |"
505-
echo "| :------- | ---: |"
508+
echo "| Language | Req/s |"
509+
echo "| :------- | ----: |"
506510
echo "$results" | jq -r 'to_entries | map([.key, .value.rate]) | sort_by(.[1]) | reverse | .[] | @tsv' | awk -F'\t' '{printf "| %-10s | %10d |\n", $1, $2}'
507511
echo "</details>"
508512
echo 'EOF'

scripts/ci/githubActions/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export const DEPENDENCIES = LANGUAGES.reduce(
4444
finalDependencies[key] = [
4545
':!**node_modules',
4646
`templates/${lang}`,
47+
`templates/issue.yml`,
48+
`templates/LICENSE`,
4749
// language related files
4850
langFolder,
4951
getVersionFileForLanguage(lang),

0 commit comments

Comments
 (0)