10 Commits

Author SHA1 Message Date
3d496d23ca parse arch.list
All checks were successful
Gentoo Utils / build-oci-image (pull_request) Successful in 3s
Gentoo Utils / build (pull_request) Successful in 32s
2025-12-13 05:37:42 +00:00
d2e8078c70 read global package.mask
All checks were successful
Gentoo Utils / build-oci-image (pull_request) Successful in 4s
Gentoo Utils / build (pull_request) Successful in 32s
2025-12-13 04:53:32 +00:00
6194121072 add mockrepo tests
All checks were successful
Gentoo Utils / build-oci-image (pull_request) Successful in 5s
Gentoo Utils / build (pull_request) Successful in 35s
2025-12-13 03:35:54 +00:00
48a276cc8b read repo_name when opening repos 2025-12-12 04:48:30 +00:00
bd7000d5ac default to Eapi 0 if no eapi file exists 2025-12-12 04:48:30 +00:00
11a7852205 add docs to profile module 2025-12-12 04:48:30 +00:00
9868ca3b32 read deprecated file in profiles 2025-12-12 04:48:30 +00:00
0df008a273 read eapi file in profiles 2025-12-12 04:48:30 +00:00
e46319cbd5 add profile related source files to sources variable 2025-12-12 04:48:30 +00:00
b4f12f6ddc impl profile evaluation 2025-12-12 04:48:30 +00:00
3 changed files with 19 additions and 122 deletions

View File

@@ -31,6 +31,4 @@ USER gentooligan
WORKDIR /workspace
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]
ENTRYPOINT /bin/bash

View File

@@ -1,6 +0,0 @@
#!/usr/bin/env sh
source /etc/profile
source /lib/gentoo/functions.sh
exec "$@"

View File

@@ -1,22 +1,17 @@
name: Gentoo Utils
on: [push]
defaults:
run:
shell: bash -l {0}
on:
push:
branches:
'*'
pull_request:
branches: [master]
jobs:
build-oci-image:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Restore git cache
uses: actions/cache@v4
with:
path: .git
key: gitea-repo-${{ gitea.repository }}-${{ gitea.ref }}
- name: Checkout repo
uses: actions/checkout@v5
with:
@@ -24,132 +19,42 @@ jobs:
- name: Check for changes before building
id: image-changes
# build image only if 1. changes are detected or 2. an image for the working branch doesnt exist
run: |
branch_name="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
default_branch_name="${{ gitea.event.repository.default_branch }}"
image_tag=latest
comparison_hash="${{ gitea.event.before }}"
if [[ "$branch_name" != "$default_branch_name" ]]; then
image_tag=$branch_name
fi
# slugify
image_tag="$(echo "$image_tag" | sed -E 's/[^a-zA-Z0-9]/-/g')"
# rebase breaks gitea.event.before, so check to make sure the hash provided exists
if ! git merge-base --is-ancestor $comparison_hash $branch_name >/dev/null 2>&1; then
comparison_hash=$(git merge-base origin/$default_branch_name $branch_name)
fi
if ! git diff $comparison_hash ${{ gitea.sha }} --no-patch --exit-code .docker; then
build_image=true
echo "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITEA_OUTPUT
if ! git diff ${{ gitea.event.before }} ${{ gitea.sha }} --no-patch --exit-code .docker; then
echo changes_detected=true >> $GITEA_OUTPUT
else
if ! docker manifest inspect ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${image_tag} >/dev/null 2>&1; then
build_image=true
else
build_image=false
fi
echo changes_detected=false >> $GITEA_OUTPUT
fi
echo "default_branch_name=$default_branch_name" >> $GITEA_OUTPUT
echo "branch_name=$branch_name" >> $GITEA_OUTPUT
echo "image_tag=$image_tag" >> $GITEA_OUTPUT
echo "comparison_hash=$comparison_hash" >> $GITEA_OUTPUT
echo "build_image=$build_image" >> $GITEA_OUTPUT
cat $GITEA_OUTPUT
- name: Set up Docker buildx
if: steps.image-changes.outputs.build_image == 'true'
if: steps.image-changes.outputs.changes_detected == 'true'
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=runners-net
- name: Log in to Github Container Registry
if: steps.image-changes.outputs.build_image == 'true'
if: steps.image-changes.outputs.changes_detected == 'true'
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY_URL }}
registry: git.epenguin.net
username: ${{ vars.CI_BOT_USERNAME }}
password: ${{ secrets.CI_BOT_TOKEN }}
- name: Build and push
if: steps.image-changes.outputs.build_image == 'true'
if: steps.image-changes.outputs.changes_detected == 'true'
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ steps.image-changes.outputs.image_tag }}
tags: git.epenguin.net/${{ gitea.repository }}:latest
context: "{{defaultContext}}:.docker"
cache-from: type=gha
cache-to: type=gha,mode=max
outputs:
image_tag: ${{ steps.image-changes.outputs.image_tag }}
build:
runs-on: brutalisk
env:
CC: 'clang'
CXX: 'clang++'
needs: build-oci-image
container:
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
image: git.epenguin.net/gentoo-utils/gentoo-utils-gitea:latest
needs: build-oci-image
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: build and check
run: |
echo $USER
echo "CC=$CC"
echo "CXX=$CXX"
source /etc/profile
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized -Ddocs=enabled build
meson compile -C build
# FIXME: Currently this rebuilds everything. Instead we should bring over the build dir from the build job. This will come in handy
# when we have multiple build targets and configs. What we have currently is fine until we get lots of builds going
test:
runs-on: brutalisk
env:
CC: 'clang'
CXX: 'clang++'
needs: [build-oci-image, build]
container:
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: test
run: |
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized -Ddocs=enabled build
meson compile -C build
ninja test -C build
check-format:
runs-on: brutalisk
needs: [build-oci-image]
container:
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Check Formatting
run: |
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized build
meson format --check-only --recursive
ninja rustfmt -C build
docs:
runs-on: brutalisk
needs: [build-oci-image]
container:
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Build Documentation
run: |
meson setup -Ddocs=enabled docs
ninja rustdoc -C docs
run: ./check.sh