-
Notifications
You must be signed in to change notification settings - Fork 868
237 lines (216 loc) · 7.4 KB
/
Copy pathmatrix-smoke.yml
File metadata and controls
237 lines (216 loc) · 7.4 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
name: Matrix Smoke
on:
pull_request:
push:
branches:
- main
- master
permissions:
contents: read
jobs:
linux-smoke:
runs-on: ubuntu-latest
defaults:
run:
working-directory: dream-server
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: AMD Path Smoke
run: bash tests/smoke/linux-amd.sh
- name: NVIDIA Path Smoke
run: bash tests/smoke/linux-nvidia.sh
- name: WSL Logic Smoke
run: bash tests/smoke/wsl-logic.sh
- name: Mobile Dispatch Smoke
run: bash tests/smoke/mobile-dispatch.sh
# Multi-distro installer detection tests (dry-run, no GPU required)
distro-matrix:
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-24.04
container: ubuntu:24.04
expected_pkg: apt
- distro: ubuntu-22.04
container: ubuntu:22.04
expected_pkg: apt
- distro: debian-12
container: debian:12
expected_pkg: apt
- distro: linux-mint-21.3
container: linuxmintd/mint21.3-amd64:latest
expected_pkg: apt
- distro: fedora-41
container: fedora:41
expected_pkg: dnf
- distro: rocky-9
container: rockylinux:9
expected_pkg: dnf
- distro: archlinux
container: archlinux:latest
expected_pkg: pacman
- distro: manjaro
container: manjarolinux/base:latest
expected_pkg: pacman
- distro: cachyos
container: cachyos/cachyos:latest
expected_pkg: pacman
- distro: opensuse-tw
container: opensuse/tumbleweed:latest
expected_pkg: zypper
runs-on: ubuntu-latest
container: ${{ matrix.container }}
defaults:
run:
working-directory: dream-server
name: "distro: ${{ matrix.distro }}"
steps:
- name: Install checkout prerequisites (distro-aware)
working-directory: /
run: |
retry() {
attempt=1
max=3
delay=15
until "$@"; do
status=$?
if [ "$attempt" -ge "$max" ]; then
return "$status"
fi
echo "Command failed (attempt ${attempt}/${max}): $*"
echo "Retrying in ${delay}s..."
sleep "$delay"
attempt=$((attempt + 1))
done
}
prepare_pacman_keyrings() {
command -v pacman-key >/dev/null 2>&1 || return 0
pacman-key --init || true
for ring in archlinux manjaro cachyos; do
if [ -f "/usr/share/pacman/keyrings/${ring}.gpg" ]; then
pacman-key --populate "$ring" || true
fi
done
}
if command -v apt-get &>/dev/null; then
apt-get update -qq && apt-get install -y -qq ca-certificates git curl
elif command -v dnf &>/dev/null; then
dnf install -y -q ca-certificates git curl-minimal
elif command -v pacman &>/dev/null; then
prepare_pacman_keyrings
retry pacman -Syyu --noconfirm --needed ca-certificates git curl
elif command -v zypper &>/dev/null; then
retry zypper --non-interactive --gpg-auto-import-keys refresh
retry zypper --non-interactive install -y ca-certificates git curl
fi
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Verify /etc/os-release
working-directory: /
shell: bash
run: |
echo "=== /etc/os-release ==="
cat /etc/os-release
. /etc/os-release
echo "ID=$ID"
echo "ID_LIKE=${ID_LIKE:-none}"
- name: Test packaging.sh detection
shell: bash
run: |
# Source the packaging library and verify detection
export LOG_FILE=/dev/null
log() { echo "[INFO] $1"; }
warn() { echo "[WARN] $1"; }
error() { echo "[ERROR] $1"; exit 1; }
source installers/lib/packaging.sh
detect_pkg_manager
echo "Detected: PKG_MANAGER=$PKG_MANAGER"
echo "Expected: ${{ matrix.expected_pkg }}"
if [[ "$PKG_MANAGER" != "${{ matrix.expected_pkg }}" ]]; then
echo "FAIL: expected ${{ matrix.expected_pkg }}, got $PKG_MANAGER"
exit 1
fi
echo "PASS: package manager detection correct"
- name: Test pkg_install (install jq + rsync)
shell: bash
run: |
export LOG_FILE=/dev/null
log() { echo "[INFO] $1"; }
warn() { echo "[WARN] $1"; }
error() { echo "[ERROR] $1"; exit 1; }
source installers/lib/packaging.sh
detect_pkg_manager
pkg_update
pkg_install curl jq rsync || echo "WARN: jq/rsync install failed (may not be in repos)"
# Verify the core tools used by installer phases.
if command -v curl &>/dev/null; then
echo "PASS: curl available"
else
echo "FAIL: curl not available after pkg_install"
exit 1
fi
if command -v rsync &>/dev/null; then
echo "PASS: rsync available"
else
echo "FAIL: rsync not available after pkg_install"
exit 1
fi
- name: Test installer bash syntax
run: |
bash -n install-core.sh
bash -n installers/lib/packaging.sh
for f in installers/phases/*.sh; do
bash -n "$f" && echo " OK: $f" || echo " FAIL: $f"
done
macos-smoke:
runs-on: macos-latest
defaults:
run:
working-directory: dream-server
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: macOS Dispatch Smoke
run: bash tests/smoke/macos-dispatch.sh
- name: Bash 3.2 syntax check (catches declare -g, associative arrays, etc.)
run: |
echo "=== Checking installer scripts for Bash 3.2 compatibility ==="
FAIL=0
for f in install-core.sh installers/phases/*.sh installers/lib/*.sh; do
if [[ -f "$f" ]]; then
# macOS ships Bash 3.2 at /bin/bash — use it for syntax check
if /bin/bash -n "$f" 2>/dev/null; then
echo " OK: $f"
else
echo " FAIL: $f"
FAIL=1
fi
fi
done
# Also check macOS-specific scripts
for f in installers/macos/**/*.sh; do
if [[ -f "$f" ]]; then
if /bin/bash -n "$f" 2>/dev/null; then
echo " OK: $f"
else
echo " FAIL: $f"
FAIL=1
fi
fi
done
if [[ $FAIL -eq 1 ]]; then
echo ""
echo "FAIL: Some scripts have Bash 3.2 syntax errors."
echo "Common issues: declare -g, associative arrays (declare -A),"
echo " &>> redirection, |& pipes, [[ with regex =~"
exit 1
fi
echo "PASS: All installer scripts parse under Bash 3.2"