104 lines
3.6 KiB
YAML
104 lines
3.6 KiB
YAML
name: SamiOS CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
pull_request:
|
|
branches: [master, main]
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install shellcheck
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y -qq shellcheck
|
|
|
|
- name: Install Make
|
|
run: |
|
|
if ! command -v make >/dev/null 2>&1; then
|
|
sudo apt-get install -y -qq make
|
|
fi
|
|
|
|
# ── Shellcheck ───────────────────────────────────────────────────
|
|
- name: Run shellcheck on all shell scripts
|
|
run: make lint
|
|
|
|
# ── Profile structure validation ─────────────────────────────────
|
|
- name: Validate archiso profile structure
|
|
run: |
|
|
set -e
|
|
PROFILE_DIR="packaging/archiso"
|
|
echo "Validating profile structure..."
|
|
|
|
# Required files
|
|
for f in profiledef.sh packages.x86_64 pacman.conf; do
|
|
if [ ! -f "$PROFILE_DIR/$f" ]; then
|
|
echo "ERROR: Missing required file: $PROFILE_DIR/$f"
|
|
exit 1
|
|
fi
|
|
echo " ✓ Found: $PROFILE_DIR/$f"
|
|
done
|
|
|
|
# profiledef.sh must have valid bash syntax
|
|
if ! bash -n "$PROFILE_DIR/profiledef.sh"; then
|
|
echo "ERROR: profiledef.sh has syntax errors"
|
|
exit 1
|
|
fi
|
|
echo " ✓ profiledef.sh syntax OK"
|
|
|
|
# packages.x86_64 must have at least one non-comment line
|
|
pkg_count=$(grep -vE '^\s*#|^\s*$' "$PROFILE_DIR/packages.x86_64" | wc -l)
|
|
if [ "$pkg_count" -lt 1 ]; then
|
|
echo "ERROR: packages.x86_64 has no packages listed"
|
|
exit 1
|
|
fi
|
|
echo " ✓ packages.x86_64 has $pkg_count package(s)"
|
|
|
|
# pacman.conf must have [options] and at least one repo section
|
|
if ! grep -q '\[options\]' "$PROFILE_DIR/pacman.conf"; then
|
|
echo "ERROR: pacman.conf missing [options] section"
|
|
exit 1
|
|
fi
|
|
if ! grep -qE '^\[(core|extra)\]' "$PROFILE_DIR/pacman.conf"; then
|
|
echo "ERROR: pacman.conf missing [core] or [extra] section"
|
|
exit 1
|
|
fi
|
|
echo " ✓ pacman.conf structure OK"
|
|
|
|
# Required airootfs files
|
|
for f in airootfs/usr/local/bin/samios; do
|
|
if [ ! -f "$PROFILE_DIR/$f" ]; then
|
|
echo "ERROR: Missing: $PROFILE_DIR/$f"
|
|
exit 1
|
|
fi
|
|
echo " ✓ Found: $PROFILE_DIR/$f"
|
|
done
|
|
|
|
# samios CLI must be executable
|
|
if [ ! -x "$PROFILE_DIR/airootfs/usr/local/bin/samios" ]; then
|
|
echo "ERROR: samios CLI is not executable"
|
|
exit 1
|
|
fi
|
|
echo " ✓ samios CLI is executable"
|
|
|
|
# Boot mode configs
|
|
for f in grub/grub.cfg syslinux/syslinux.cfg efiboot/loader/loader.conf; do
|
|
if [ ! -f "$PROFILE_DIR/$f" ]; then
|
|
echo "WARNING: Missing optional boot config: $PROFILE_DIR/$f"
|
|
else
|
|
echo " ✓ Found: $PROFILE_DIR/$f"
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "Profile structure validation PASSED ✓"
|
|
|
|
# ── Test suite ───────────────────────────────────────────────────
|
|
- name: Run test suite
|
|
run: make test
|