FROM pentoolinux/pentoo-full ARG github_sha # Setup repos WORKDIR /var/db/repos/ # setup gentoo repo RUN git clone https://github.com/gentoo/gentoo.git --depth 1 # setup pentoo repo #RUN git clone https://github.com/pentoo/pentoo-overlay.git pentoo --depth 1 # Use the github checkout for pentoo, that's what we are testing COPY . pentoo #Regen doubles the time it takes for the action to run #Revisit if this is worth running when we have >2 emerge calls #RUN time FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" emerge --regen --jobs=$(nproc) --quiet # disable minimal (pentoo-core is default minimal) RUN sed -i 's# pentoo-minimal##' /etc/portage/make.conf WORKDIR /var/db/repos/pentoo RUN 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}"