Skip to content

Commit 33cad38

Browse files
committed
build: process directories individually
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: passed - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent a8a346c commit 33cad38

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/scripts/run_affected_benchmarks

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,14 @@ main() {
132132
done
133133

134134
# Find all benchmark files in package directories:
135-
js_bench_files=$(find "${directories}" -maxdepth 3 -wholename '**/benchmark/benchmark*.js' | grep -v '/fixtures/' | sort -u | tr '\n' ' ') || true
135+
js_bench_files=""
136+
for dir in ${directories}; do
137+
if [ -d "${dir}" ]; then
138+
files=$(find "${dir}" -maxdepth 3 -wholename '**/benchmark/benchmark*.js' | grep -v '/fixtures/' | sort -u | tr '\n' ' ') || true
139+
js_bench_files="${js_bench_files} ${files}"
140+
fi
141+
done
142+
js_bench_files=$(echo "${js_bench_files}" | xargs)
136143

137144
# Run JS benchmarks:
138145
if [ -n "${js_bench_files}" ]; then
@@ -143,10 +150,25 @@ main() {
143150

144151
# Run C benchmarks:
145152
echo "Finding C benchmark files in ${directories}..."
146-
c_bench_files=$(find "${directories}" -maxdepth 5 \( -wholename '**/benchmark/c/benchmark*.c' -or -wholename '**/benchmark/c/**/benchmark*.c' \) -exec realpath {} \; | grep -v '/fixtures/' | sort -u | tr '\n' ' ') || true
153+
c_bench_files=""
154+
for dir in ${directories}; do
155+
if [ -d "${dir}" ]; then
156+
files=$(find "${dir}" -maxdepth 5 \( -wholename '**/benchmark/c/benchmark*.c' -or -wholename '**/benchmark/c/**/benchmark*.c' \) -exec realpath {} \; | grep -v '/fixtures/' | sort -u | tr '\n' ' ') || true
157+
c_bench_files="${c_bench_files} ${files}"
158+
fi
159+
done
160+
c_bench_files=$(echo "${c_bench_files}" | xargs)
147161

148162
# If benchmarks requiring Cephes are found, install the Cephes library:
149-
c_cephes_makefiles=$(find "${directories}" -maxdepth 5 -wholename '**/benchmark/c/**/Makefile' -exec grep -l 'CEPHES' {} + || true)
163+
c_cephes_makefiles=""
164+
for dir in ${directories}; do
165+
if [ -d "${dir}" ]; then
166+
files=$(find "${dir}" -maxdepth 5 -wholename '**/benchmark/c/**/Makefile' -exec grep -l 'CEPHES' {} + || true)
167+
c_cephes_makefiles="${c_cephes_makefiles} ${files}"
168+
fi
169+
done
170+
c_cephes_makefiles=$(echo "${c_cephes_makefiles}" | xargs)
171+
150172
if [ -n "${c_cephes_makefiles}" ]; then
151173
make install-deps-cephes
152174
fi

0 commit comments

Comments
 (0)