File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 - name : Checkout
1414 uses : actions/checkout@v4
1515
16+ - name : Guard local artifacts
17+ run : ./scripts/check_local_artifacts.sh
18+
1619 - name : Setup Rust
1720 uses : dtolnay/rust-toolchain@stable
1821 with :
4346 - name : Checkout
4447 uses : actions/checkout@v4
4548
49+ - name : Guard local artifacts
50+ run : ./scripts/check_local_artifacts.sh
51+
4652 - name : Install Linux native build deps
4753 run : |
4854 sudo apt-get update
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ repo_root=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /.." && pwd) "
5+ cd " $repo_root "
6+
7+ mapfile -t tracked_files < <( git ls-files)
8+ offenders=()
9+
10+ for path in " ${tracked_files[@]} " ; do
11+ case " $path " in
12+ * .DS_Store|target/* |.codex_audit/* )
13+ offenders+=(" $path " )
14+ ;;
15+ esac
16+ done
17+
18+ if [ " ${# offenders[@]} " -gt 0 ]; then
19+ echo " Local artifact guard failed."
20+ echo " Remove these tracked files before committing:"
21+ printf ' - %s\n' " ${offenders[@]} "
22+ exit 1
23+ fi
24+
25+ echo " Local artifact guard passed."
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ repo_root=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /.." && pwd) "
5+ cd " $repo_root "
6+
7+ bytes_before=" $( du -sk . 2> /dev/null | awk ' {print $1}' ) "
8+
9+ cleaned_any=0
10+
11+ # Remove macOS finder metadata files that can appear in project trees.
12+ while IFS= read -r ds_store; do
13+ if find " $ds_store " -maxdepth 1 -name ' .DS_Store' -print -quit | grep -q . ; then
14+ find " $ds_store " -maxdepth 1 -name ' .DS_Store' -delete
15+ cleaned_any=1
16+ fi
17+ done < <( printf ' %s\n' " $repo_root " " $( dirname " $repo_root " ) " )
18+
19+ # Remove generated Rust build output.
20+ if [ -d " target" ]; then
21+ find target -depth -mindepth 1 -delete
22+ rmdir target 2> /dev/null || true
23+ cleaned_any=1
24+ fi
25+
26+ # Remove local Codex audit scratch artifacts if present.
27+ if [ -d " .codex_audit" ]; then
28+ find .codex_audit -depth -mindepth 1 -delete
29+ rmdir .codex_audit 2> /dev/null || true
30+ cleaned_any=1
31+ fi
32+
33+ bytes_after=" $( du -sk . 2> /dev/null | awk ' {print $1}' ) "
34+ freed_kb=$(( bytes_before - bytes_after))
35+ if [ " $freed_kb " -lt 0 ]; then
36+ freed_kb=0
37+ fi
38+
39+ if [ " $cleaned_any " -eq 1 ]; then
40+ echo " Cleanup complete. Freed approximately ${freed_kb} KB."
41+ else
42+ echo " Nothing to clean."
43+ fi
You can’t perform that action at this time.
0 commit comments