diff --git a/.github/workflows/pentoo-build-test.yaml b/.github/workflows/pentoo-build-test.yaml new file mode 100644 index 000000000..d9b1bb131 --- /dev/null +++ b/.github/workflows/pentoo-build-test.yaml @@ -0,0 +1,26 @@ +name: Pentoo Build Test + +on: + pull_request: + branches: + - master + +jobs: + pentoo-build-test: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: List added files + run: git diff-tree --no-commit-id --name-only -r ${{ github.sha }} + - + name: Pentoo Build Test + run: | + sudo docker build --progress=plain --build-arg github_sha="${{ github.sha }}" . -f scripts/qa/Dockerfile.build diff --git a/scripts/qa/Dockerfile.build b/scripts/qa/Dockerfile.build new file mode 100644 index 000000000..1ad58a208 --- /dev/null +++ b/scripts/qa/Dockerfile.build @@ -0,0 +1,36 @@ +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}"