Skip to content

Commit bb2a881

Browse files
CopilotBrooooooklyn
andcommitted
Fix CI benchmark data collection to handle directories with file extensions
Co-authored-by: Brooooooklyn <[email protected]>
1 parent 5696fc5 commit bb2a881

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ jobs:
3030
- name: Collect benchmark data
3131
run: |
3232
mkdir -p benchmark_data
33-
find /tmp/affine/AFFiNE-0.23.2 -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -type f | \
33+
find /tmp/affine/AFFiNE-0.23.2 -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) | \
3434
while IFS= read -r file; do
35-
echo "// File: $file" >> benchmark_data/all_files.js
36-
cat "$file" >> benchmark_data/all_files.js
37-
echo -e "\n\n" >> benchmark_data/all_files.js
35+
if [ -f "$file" ] && [ -r "$file" ]; then
36+
echo "// File: $file" >> benchmark_data/all_files.js
37+
cat "$file" >> benchmark_data/all_files.js 2>/dev/null || echo "// Failed to read $file" >> benchmark_data/all_files.js
38+
echo -e "\n\n" >> benchmark_data/all_files.js
39+
fi
3840
done
39-
find /tmp/affine/AFFiNE-0.23.2 -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -type f > benchmark_data/file_list.txt
41+
find /tmp/affine/AFFiNE-0.23.2 -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) > benchmark_data/file_list.txt
4042
echo "Collected $(wc -l < benchmark_data/file_list.txt) files ($(wc -c < benchmark_data/all_files.js) bytes)"
4143
- name: Build benchmark binary
4244
run: cargo build --release --bin affine_bench

0 commit comments

Comments
 (0)