Revert "Add Git LFS support for large cache files in GitHub Actions workflow …" (#397)
Browse filesThis reverts commit aa79a85c3a07fea223f64a45588ccddf5b046625.
.github/workflows/generate_cached_results.yml
CHANGED
|
@@ -22,7 +22,6 @@ jobs:
|
|
| 22 |
with:
|
| 23 |
fetch-depth: 0
|
| 24 |
token: ${{ secrets.GITHUB_TOKEN }}
|
| 25 |
-
lfs: true
|
| 26 |
|
| 27 |
- name: Setup Python
|
| 28 |
uses: actions/setup-python@v5
|
|
@@ -40,14 +39,6 @@ jobs:
|
|
| 40 |
env:
|
| 41 |
PYTHONUNBUFFERED: 1
|
| 42 |
|
| 43 |
-
- name: Install Git LFS
|
| 44 |
-
run: |
|
| 45 |
-
sudo apt-get update
|
| 46 |
-
sudo apt-get install -y git-lfs
|
| 47 |
-
git lfs install
|
| 48 |
-
# Explicitly pull LFS files to work around checkout action issues
|
| 49 |
-
git lfs pull || true
|
| 50 |
-
|
| 51 |
- name: Configure Git
|
| 52 |
run: |
|
| 53 |
git config --global user.name "github-actions[bot]"
|
|
@@ -75,8 +66,6 @@ jobs:
|
|
| 75 |
echo "📋 Switching to existing cached-data branch"
|
| 76 |
git checkout cached-data
|
| 77 |
git pull origin cached-data
|
| 78 |
-
# Ensure LFS files are available after branch checkout
|
| 79 |
-
git lfs pull || true
|
| 80 |
else
|
| 81 |
echo "🆕 Creating new cached-data branch"
|
| 82 |
git checkout --orphan cached-data
|
|
@@ -89,20 +78,15 @@ jobs:
|
|
| 89 |
mv __cached_results.json.gz.tmp __cached_results.json.gz
|
| 90 |
fi
|
| 91 |
|
| 92 |
-
# Setup Git LFS tracking for the cache file (if not already tracked)
|
| 93 |
-
if ! git lfs ls-files | grep -q "__cached_results.json.gz"; then
|
| 94 |
-
git lfs track "__cached_results.json.gz"
|
| 95 |
-
fi
|
| 96 |
-
|
| 97 |
# Ensure we only have the files we want
|
| 98 |
-
# Remove all tracked files except README.md
|
| 99 |
if [ -f "README.md" ]; then
|
| 100 |
-
git ls-files | grep -v "README.md" |
|
| 101 |
else
|
| 102 |
-
git ls-files |
|
| 103 |
fi
|
| 104 |
|
| 105 |
-
# Add the cached results file
|
| 106 |
git add __cached_results.json.gz
|
| 107 |
|
| 108 |
# Preserve README.md if it exists in the working directory
|
|
@@ -110,11 +94,6 @@ jobs:
|
|
| 110 |
git add README.md
|
| 111 |
fi
|
| 112 |
|
| 113 |
-
# Add .gitattributes file (required for LFS tracking)
|
| 114 |
-
if [ -f ".gitattributes" ]; then
|
| 115 |
-
git add .gitattributes
|
| 116 |
-
fi
|
| 117 |
-
|
| 118 |
# Check if there are changes to commit
|
| 119 |
if git diff --staged --quiet; then
|
| 120 |
echo "✅ No changes in cached results, skipping commit"
|
|
@@ -122,7 +101,7 @@ jobs:
|
|
| 122 |
# Verify we're not committing too many files (safety check)
|
| 123 |
STAGED_FILES=$(git diff --staged --name-only | wc -l)
|
| 124 |
if [ "$STAGED_FILES" -gt 10 ]; then
|
| 125 |
-
echo "❌ ERROR: Too many files staged ($STAGED_FILES). Expected only 1-
|
| 126 |
echo "Staged files:"
|
| 127 |
git diff --staged --name-only
|
| 128 |
exit 1
|
|
@@ -133,7 +112,7 @@ jobs:
|
|
| 133 |
COMMIT_MSG="Update cached results - $TIMESTAMP ($(echo "scale=1; $FILE_SIZE/1024/1024" | bc -l)MB)"
|
| 134 |
git commit -m "$COMMIT_MSG"
|
| 135 |
|
| 136 |
-
# Push to remote
|
| 137 |
git push origin cached-data
|
| 138 |
echo "✅ Successfully updated cached-data branch"
|
| 139 |
fi
|
|
|
|
| 22 |
with:
|
| 23 |
fetch-depth: 0
|
| 24 |
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
| 25 |
|
| 26 |
- name: Setup Python
|
| 27 |
uses: actions/setup-python@v5
|
|
|
|
| 39 |
env:
|
| 40 |
PYTHONUNBUFFERED: 1
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
- name: Configure Git
|
| 43 |
run: |
|
| 44 |
git config --global user.name "github-actions[bot]"
|
|
|
|
| 66 |
echo "📋 Switching to existing cached-data branch"
|
| 67 |
git checkout cached-data
|
| 68 |
git pull origin cached-data
|
|
|
|
|
|
|
| 69 |
else
|
| 70 |
echo "🆕 Creating new cached-data branch"
|
| 71 |
git checkout --orphan cached-data
|
|
|
|
| 78 |
mv __cached_results.json.gz.tmp __cached_results.json.gz
|
| 79 |
fi
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
# Ensure we only have the files we want
|
| 82 |
+
# Remove all tracked files except README.md
|
| 83 |
if [ -f "README.md" ]; then
|
| 84 |
+
git ls-files | grep -v "README.md" | xargs -r git rm 2>/dev/null || true
|
| 85 |
else
|
| 86 |
+
git ls-files | xargs -r git rm 2>/dev/null || true
|
| 87 |
fi
|
| 88 |
|
| 89 |
+
# Add only the cached results file
|
| 90 |
git add __cached_results.json.gz
|
| 91 |
|
| 92 |
# Preserve README.md if it exists in the working directory
|
|
|
|
| 94 |
git add README.md
|
| 95 |
fi
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
# Check if there are changes to commit
|
| 98 |
if git diff --staged --quiet; then
|
| 99 |
echo "✅ No changes in cached results, skipping commit"
|
|
|
|
| 101 |
# Verify we're not committing too many files (safety check)
|
| 102 |
STAGED_FILES=$(git diff --staged --name-only | wc -l)
|
| 103 |
if [ "$STAGED_FILES" -gt 10 ]; then
|
| 104 |
+
echo "❌ ERROR: Too many files staged ($STAGED_FILES). Expected only 1-2 files."
|
| 105 |
echo "Staged files:"
|
| 106 |
git diff --staged --name-only
|
| 107 |
exit 1
|
|
|
|
| 112 |
COMMIT_MSG="Update cached results - $TIMESTAMP ($(echo "scale=1; $FILE_SIZE/1024/1024" | bc -l)MB)"
|
| 113 |
git commit -m "$COMMIT_MSG"
|
| 114 |
|
| 115 |
+
# Push to remote
|
| 116 |
git push origin cached-data
|
| 117 |
echo "✅ Successfully updated cached-data branch"
|
| 118 |
fi
|