-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI step to check for too-large files and lfs files
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
# Check for files that are too large to be checked into the repository. | ||
# Whenever we want to make an exception, we add it to `check_large_files_allow_list.txt` | ||
set -eu | ||
|
||
#find . -type f -size +300k | grep -vnE -f ./scripts/check_large_files_allow_list.txt | ||
|
||
maximum_size=$((1024 * 300)) | ||
|
||
result=0 | ||
while read -d '' -r file; do | ||
if [[ -f "$file" ]]; then | ||
actualsize=$(wc -c <"$file") | ||
if [ $actualsize -ge $maximum_size ]; then | ||
if ! grep -qx "$file" ./scripts/check_large_files_allow_list.txt; then | ||
echo $file is larger than $maximum_size bytes | ||
result=1 | ||
fi | ||
fi | ||
fi | ||
done < <(git ls-files -z --empty-directory) | ||
|
||
exit $result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rerun_py/rerun_sdk/rerun_demo/demo.rrd |