-
Notifications
You must be signed in to change notification settings - Fork 22
250 lines (226 loc) · 8.48 KB
/
Copy pathci.yml
File metadata and controls
250 lines (226 loc) · 8.48 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: Brain Shell CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
# ─────────────────────────────────────────────
# Arch Linux — pacman + AUR dry-run
# ─────────────────────────────────────────────
arch-validate:
name: Arch Linux — Dependency & Lint Check
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update pacman & install base tools
run: |
pacman -Syu --noconfirm
pacman -S --needed --noconfirm git base-devel python
- name: Validate pacman dependencies exist in repos
run: |
PACMAN_DEPS=(
hyprland qt6-base qt6-declarative qt6-multimedia
qt6-5compat qt6ct pipewire pipewire-pulse wireplumber
networkmanager bluez bluez-utils brightnessctl upower
libnotify polkit python wl-clipboard slurp xdg-user-dirs
wf-recorder cava imagemagick wtype lm_sensors util-linux
hyprsunset hyprlock hyprpolkitagent hypridle
xdg-desktop-portal-hyprland ttf-jetbrains-mono-nerd
ttf-nerd-fonts-symbols-common hyprshutdown cliphist
)
FAILED=()
for pkg in "${PACMAN_DEPS[@]}"; do
if pacman -Si "$pkg" &>/dev/null; then
echo "✓ $pkg"
else
echo "✗ $pkg (not found in repos)"
FAILED+=("$pkg")
fi
done
if [ ${#FAILED[@]} -gt 0 ]; then
echo ""
echo "Missing packages: ${FAILED[*]}"
exit 1
fi
- name: Validate AUR packages exist on AUR RPC
run: |
AUR_DEPS=(
quickshell-git
awww-git
matugen-bin
envycontrol
auto-cpufreq
nbfc-linux
grimblast-git
)
FAILED=()
for pkg in "${AUR_DEPS[@]}"; do
STATUS=$(curl -s "https://aur.archlinux.org/rpc/v5/info?arg[]=${pkg}" \
| python3 -c "import json,sys; d=json.load(sys.stdin); print('ok' if d.get('resultcount',0)>0 else 'missing')")
if [[ "$STATUS" == "ok" ]]; then
echo "✓ $pkg (AUR)"
else
echo "✗ $pkg not found on AUR"
FAILED+=("$pkg")
fi
done
if [ ${#FAILED[@]} -gt 0 ]; then
echo ""
echo "Missing AUR packages: ${FAILED[*]}"
exit 1
fi
- name: Lint install.sh
run: |
pacman -S --needed --noconfirm shellcheck
shellcheck install.sh
echo "✓ install.sh passed ShellCheck"
- name: Lint dots-extra/install-arch.sh
run: |
bash -n dots-extra/install-arch.sh
echo "✓ install-arch.sh syntax OK"
- name: Lint dots-extra/validate-install.sh
run: |
bash -n dots-extra/validate-install.sh
echo "✓ validate-install.sh passed ShellCheck"
- name: Lint shell scripts in src/scripts/
run: |
bash -n src/scripts/GfxSwitch.sh
bash -n src/scripts/PowerControl.sh
echo "✓ src/scripts/ passed ShellCheck"
- name: Check Python list_apps.py syntax
run: |
python -m py_compile src/scripts/list_apps.py
echo "✓ list_apps.py syntax OK"
- name: Validate QML files exist and are non-empty
run: |
FAILED=()
while IFS= read -r -d '' f; do
if [ ! -s "$f" ]; then
echo "✗ Empty file: $f"
FAILED+=("$f")
else
echo "✓ $f"
fi
done < <(find src -name "*.qml" -print0)
if [ ${#FAILED[@]} -gt 0 ]; then
echo "Empty QML files found!"
exit 1
fi
- name: Validate qmldir files
run: |
for f in $(find src -name "qmldir"); do
echo "✓ Found qmldir: $f"
cat "$f"
done
# ─────────────────────────────────────────────
# NixOS — flake check
# ─────────────────────────────────────────────
nix-validate:
name: NixOS — Flake & Package Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true
- name: Validate flake.nix syntax
run: |
# Check file exists and is valid UTF-8 text
cat flake.nix > /dev/null
# Use nix-instantiate for pure syntax check (no network, no path access)
nix-instantiate --parse flake.nix > /dev/null
echo "✓ flake.nix syntax OK"
- name: Validate flake.lock structure
run: |
python3 -c "
import json, sys
with open('flake.lock') as f:
lock = json.load(f)
assert lock.get('version') == 7, 'Expected lock version 7'
nodes = lock.get('nodes', {})
print(f'Lock version: {lock[\"version\"]}')
print(f'Nodes: {list(nodes.keys())}')
for name, node in nodes.items():
if 'locked' in node:
rev = node['locked'].get('rev', 'N/A')[:10]
print(f' ✓ {name}: {rev}')
"
- name: Validate flake.nix declares required outputs
run: |
python3 -c "
with open('flake.nix') as f:
content = f.read()
checks = {
'packages': 'packages' in content,
'devShells': 'devShells' in content,
'nixosModules': 'nixosModules' in content,
'description': 'description' in content,
'brain-shell': 'brain-shell' in content,
}
failed = []
for key, ok in checks.items():
if ok:
print(f' ✓ {key} declared')
else:
print(f' ✗ {key} MISSING')
failed.append(key)
if failed:
raise SystemExit(f'Missing from flake.nix: {failed}')
"
# ─────────────────────────────────────────────
# Structure Sanity Check (both runners agree)
# ─────────────────────────────────────────────
structure-check:
name: Repo Structure Sanity
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check required files exist
run: |
REQUIRED=(
"shell.qml"
"flake.nix"
"flake.lock"
"install.sh"
"dots-extra/install-arch.sh"
"dots-extra/validate-install.sh"
"src/config/brain-shell-colors.json.example"
"src/theme/Theme.qml"
"src/theme/ColorLoader.qml"
"src/state/ShellState.qml"
"src/state/Popups.qml"
"src/windows/TopBar.qml"
"src/popups/Dashboard.qml"
)
FAILED=()
for f in "${REQUIRED[@]}"; do
if [[ -f "$f" ]]; then
echo "✓ $f"
else
echo "✗ MISSING: $f"
FAILED+=("$f")
fi
done
if [ ${#FAILED[@]} -gt 0 ]; then
echo ""
echo "Missing required files: ${FAILED[*]}"
exit 1
fi
- name: Count QML files per module
run: |
echo "QML file counts by directory:"
find src -name "*.qml" | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn
- name: Check install.sh is executable or has correct shebang
run: |
head -1 install.sh | grep -q "^#!/" && echo "✓ shebang OK" || (echo "✗ Missing shebang in install.sh" && exit 1)
head -1 dots-extra/install-arch.sh | grep -q "^#!/" && echo "✓ shebang OK (arch)" || (echo "✗ Missing shebang in install-arch.sh" && exit 1)