Skip to content

Commit a6cea61

Browse files
committed
add build test
1 parent 32be679 commit a6cea61

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pentoo Build Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
pentoo-build-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0
17+
-
18+
name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
-
21+
name: List added files
22+
run: git diff-tree --no-commit-id --name-only -r ${{ github.sha }}
23+
-
24+
name: Pentoo Build Test
25+
run: |
26+
sudo docker build --progress=plain --build-arg github_sha="${{ github.sha }}" . -f scripts/qa/Dockerfile.build

‎scripts/qa/Dockerfile.build‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM pentoolinux/pentoo-full
2+
ARG github_sha
3+
# Setup repos
4+
WORKDIR /var/db/repos/
5+
# setup gentoo repo
6+
RUN git clone https://github.com/gentoo/gentoo.git --depth 1
7+
# setup pentoo repo
8+
#RUN git clone https://github.com/pentoo/pentoo-overlay.git pentoo --depth 1
9+
# Use the github checkout for pentoo, that's what we are testing
10+
COPY . pentoo
11+
12+
#Regen doubles the time it takes for the action to run
13+
#Revisit if this is worth running when we have >2 emerge calls
14+
#RUN time FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" emerge --regen --jobs=$(nproc) --quiet
15+
16+
# disable minimal (pentoo-core is default minimal)
17+
RUN sed -i 's# pentoo-minimal##' /etc/portage/make.conf
18+
19+
WORKDIR /var/db/repos/pentoo
20+
21+
RUN FAILED="0"; \
22+
for i in $(git diff-tree --no-commit-id --name-only -r ${github_sha}); do \
23+
if [ "${i%.ebuild}" != "${i}" ]; then \
24+
printf "%s looks like an ebuild, testing\n" "${i}"; \
25+
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 \
26+
printf '%s appears to be unmasked, build testing' "${i}"; \
27+
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 \
28+
printf '%s build SUCCESS\n' "${i}"; \
29+
else \
30+
printf '%s build FAILED\n' "${i}"; \
31+
FAILED="1"; \
32+
fi \
33+
fi; \
34+
fi; \
35+
done \
36+
exit "${FAILED}"

0 commit comments

Comments
 (0)