Repository navigation
119 lines (105 loc) · 3.57 KB
/
Copy pathtest-install.yml
File metadata and controls
119 lines (105 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Test Install Script
on:
push:
paths:
- 'install.sh'
- '.github/workflows/test-install.yml'
pull_request:
paths:
- 'install.sh'
- '.github/workflows/test-install.yml'
workflow_dispatch: # Allow manual trigger
jobs:
test-linux:
name: Test on Linux (Ubuntu)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Ensure clean state (no Homebrew)
run: |
# Check both PATH and direct path
if command -v brew &> /dev/null || [ -d /home/linuxbrew/.linuxbrew ]; then
echo "Removing existing Homebrew..."
# Try official uninstaller first
if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" || true
fi
# Force remove directories
sudo rm -rf /home/linuxbrew/.linuxbrew
sudo rm -rf /home/linuxbrew
fi
# Verify clean
if [ -d /home/linuxbrew ]; then
echo "ERROR: Failed to remove Homebrew"
exit 1
fi
echo "✓ Clean state confirmed"
- name: Run install script
run: |
chmod +x install.sh
./install.sh
- name: Verify installation
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "==> Checking brew..."
brew --version
echo "==> Checking bbrew..."
which bbrew
bbrew --help | head -3
echo "✓ All checks passed!"
test-macos-arm:
name: Test on macOS (Apple Silicon)
runs-on: macos-14 # M1 runner
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Ensure clean state (no Homebrew)
run: |
if command -v brew &> /dev/null || [ -d /opt/homebrew ]; then
echo "Removing existing Homebrew..."
if [ -x /opt/homebrew/bin/brew ]; then
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" || true
fi
sudo rm -rf /opt/homebrew
fi
if [ -d /opt/homebrew ]; then
echo "ERROR: Failed to remove Homebrew"
exit 1
fi
echo "✓ Clean state confirmed"
- name: Run install script
run: |
chmod +x install.sh
./install.sh
- name: Verify installation
run: |
eval "$(/opt/homebrew/bin/brew shellenv)"
echo "==> Checking brew..."
brew --version
echo "==> Checking bbrew..."
which bbrew
bbrew --help | head -3
echo "✓ All checks passed!"
test-already-installed:
name: Test upgrade path (Homebrew already installed)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Pre-install Homebrew
run: |
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew --version
echo "✓ Homebrew pre-installed"
- name: Run install script (should detect existing install)
run: |
chmod +x install.sh
./install.sh
- name: Verify bbrew installed
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
which bbrew
bbrew --help | head -3
echo "✓ Upgrade path works!"