Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 40 additions & 18 deletions .github/actions/setup-cmux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,23 @@ runs:
restore-keys: |
${{ runner.os }}-bun-cache-

- name: Cache Homebrew (macOS)
- name: Cache ImageMagick (macOS)
if: runner.os == 'macOS'
id: cache-imagemagick-mac
uses: actions/cache@v4
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-brew-cache-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-brew-cache-
path: |
/opt/homebrew/Cellar/imagemagick
/usr/local/Cellar/imagemagick
key: ${{ runner.os }}-${{ runner.arch }}-imagemagick-7.1.1

- name: Cache apt packages (Linux)
if: runner.os == 'Linux'
id: cache-apt
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-imagemagick-v1

- name: Install dependencies
shell: bash
Expand All @@ -46,25 +55,38 @@ runs:
if: runner.os == 'macOS'
shell: bash
run: |
if ! brew list imagemagick &>/dev/null; then
echo "πŸ“¦ Installing ImageMagick..."
time brew install imagemagick
if [ "${{ steps.cache-imagemagick-mac.outputs.cache-hit }}" == "true" ]; then
echo "βœ… ImageMagick restored from cache"
# Link the cached installation
brew link --overwrite --force imagemagick 2>/dev/null || true
if command -v magick &>/dev/null; then
magick --version | head -1
else
echo "⚠️ Cache restored but linking failed, reinstalling..."
HOMEBREW_NO_AUTO_UPDATE=1 brew install imagemagick
magick --version | head -1
fi
else
echo "βœ… ImageMagick already installed"
brew list imagemagick --versions
echo "πŸ“¦ Installing ImageMagick..."
HOMEBREW_NO_AUTO_UPDATE=1 brew install imagemagick
magick --version | head -1
fi
# Verify it's in PATH
which magick
magick --version | head -1

- name: Install ImageMagick (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
if ! command -v convert &> /dev/null; then
echo "Installing ImageMagick..."
sudo apt-get update -qq
sudo apt-get install -y imagemagick
if command -v convert &>/dev/null; then
echo "βœ… ImageMagick already installed"
convert --version | head -1
else
echo "ImageMagick already installed"
echo "πŸ“¦ Installing ImageMagick..."
# Restore apt cache permissions if cache was restored
if [ "${{ steps.cache-apt.outputs.cache-hit }}" == "true" ]; then
sudo chmod -R 755 /var/cache/apt/archives 2>/dev/null || true
fi
# Update only if needed and install with minimal dependencies
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends imagemagick
convert --version | head -1
fi
Loading