pentoo-overlay/scripts/qa/test-build
2025-12-11 22:02:12 -05:00

17 lines
867 B
Bash
Executable file

#!/bin/bash
FAILED="0"
for i in $(git diff-tree --no-commit-id --name-only -r "${github_sha}"); do
if [ "${i%.ebuild}" != "${i}" ]; then
printf "%s looks like an ebuild, testing\n" "${i}"
if FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" emerge --getbinpkg=y --buildpkg=n --jobs="$(nproc)" --load-average="$(nproc)" --verbose "$(printf '%s' "${i%.ebuild}" | awk -F'/' '{print "="$1"/"$3}')" --pretend; then
printf '%s appears to be unmasked, build testing' "${i}"
if FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" emerge --getbinpkg=y --buildpkg=n --jobs="$(nproc)" --load-average="$(nproc)" --verbose "$(printf '%s' "${i%.ebuild}" | awk -F'/' '{print "="$1"/"$3}')"; then
printf '%s build SUCCESS\n' "${i}"
else
printf '%s build FAILED\n' "${i}"
FAILED="1"
fi
fi
fi
done
exit "${FAILED}"