mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-01-15 20:55:18 +01:00
add build test
This commit is contained in:
parent
32be6798d9
commit
a6cea61800
2 changed files with 62 additions and 0 deletions
26
.github/workflows/pentoo-build-test.yaml
vendored
Normal file
26
.github/workflows/pentoo-build-test.yaml
vendored
Normal file
|
|
@ -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
|
||||
36
scripts/qa/Dockerfile.build
Normal file
36
scripts/qa/Dockerfile.build
Normal file
|
|
@ -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}"
|
||||
Loading…
Reference in a new issue