fix: CI workflow only syncs from ~/archy if checkout failed

The rsync step was unconditionally overwriting the git checkout with
~/archy (which had diverged commit history), causing every CI build to
use wrong code. Now only falls back to rsync if checkout didn't produce
a valid workspace. Also removed --delete to prevent destroying checkout
files, and updated verification checks.

Root cause of CI build #373 using stale code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-02 13:47:12 +01:00
parent 5456c63a08
commit 7425386312

View File

@ -11,31 +11,33 @@ jobs:
timeout-minutes: 60
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
timeout-minutes: 3
continue-on-error: true
- name: Sync from local repo (fast LAN fallback)
- name: Sync from local repo (fallback if checkout failed)
run: |
# actions/checkout fetches via WAN which is unreliable
# ~/archy is kept in sync via rsync from dev machine
if [ -d "$HOME/archy/.gitea" ]; then
echo "Syncing from ~/archy (rsync'd source)..."
rsync -a --delete \
# Only sync from ~/archy if checkout failed or workspace is empty
if [ -f "CLAUDE.md" ] && [ -d "core" ] && [ -d "neode-ui" ]; then
echo "Checkout succeeded — using checked-out code"
elif [ -d "$HOME/archy/core" ] && [ -d "$HOME/archy/neode-ui" ]; then
echo "Checkout failed — syncing from ~/archy (LAN fallback)..."
rsync -a \
--exclude '.git' --exclude 'node_modules' --exclude 'target' \
--exclude 'image-recipe/build' --exclude 'image-recipe/results' \
--exclude 'web/dist' \
"$HOME/archy/" ./
echo "Synced. Latest commit msg from source:"
head -1 "$HOME/archy/.gitea/workflows/build-iso-dev.yml"
else
echo "No local repo at ~/archy, relying on checkout"
echo "ERROR: No checkout and no local fallback"
exit 1
fi
echo "Workspace verification:"
grep 'torConnected' neode-ui/src/views/Home.vue && echo " Home.vue changes: PRESENT" || echo " Home.vue changes: MISSING"
grep 'host.containers.internal:host-gateway' scripts/first-boot-containers.sh && echo " Container DNS fix: PRESENT" || echo " Container DNS fix: MISSING"
[ -f "scripts/first-boot-containers.sh" ] && echo " first-boot-containers.sh: PRESENT" || echo " first-boot-containers.sh: MISSING"
grep -q 'network-alias' scripts/first-boot-containers.sh 2>/dev/null && echo " network-alias fix: PRESENT" || echo " network-alias fix: MISSING"
grep -q 'apache2-utils' image-recipe/build-auto-installer-iso.sh 2>/dev/null && echo " apache2-utils: PRESENT" || echo " apache2-utils: MISSING"
- name: Install ISO build dependencies
run: |