Skip to content

Commit 00f9d63

Browse files
committed
Add verbose logging and artifacts to Homebrew CI
Improvements for better debugging: 1. Capture all build output to /tmp/brew-install.log using tee 2. Display last 200 lines of build log on failure 3. Display all Homebrew log files from ~/Library/Logs/Homebrew/mfc/ 4. Upload logs as artifacts on failure for download This allows viewing all errors directly in GitHub Actions UI without needing to copy/paste, and provides downloadable artifacts for deeper investigation.
1 parent 9823cfe commit 00f9d63

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/homebrew.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,35 @@ jobs:
5151
cp packaging/homebrew/mfc.rb $(brew --repository)/Library/Taps/mflowcode/homebrew-test/Formula/mfc.rb
5252
5353
echo "Installing MFC from local tap..."
54-
brew install --build-from-source --verbose mflowcode/test/mfc
54+
brew install --build-from-source --verbose mflowcode/test/mfc 2>&1 | tee /tmp/brew-install.log
55+
56+
- name: Display error logs on failure
57+
if: failure()
58+
run: |
59+
echo "=== Displaying last 200 lines of brew install log ==="
60+
if [ -f /tmp/brew-install.log ]; then
61+
tail -200 /tmp/brew-install.log
62+
fi
63+
64+
echo -e "\n=== Displaying Homebrew log files ==="
65+
if [ -d ~/Library/Logs/Homebrew/mfc/ ]; then
66+
for logfile in ~/Library/Logs/Homebrew/mfc/*; do
67+
if [ -f "$logfile" ]; then
68+
echo -e "\n\n====== $logfile ======"
69+
cat "$logfile"
70+
fi
71+
done
72+
fi
73+
74+
- name: Upload Homebrew logs on failure
75+
if: failure()
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: homebrew-logs
79+
path: |
80+
/tmp/brew-install.log
81+
~/Library/Logs/Homebrew/mfc/
82+
if-no-files-found: ignore
5583

5684
- name: Run formula tests
5785
run: |

0 commit comments

Comments
 (0)