Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ jobs:
path: build/boot.img
if-no-files-found: error

- name: upload kernel profile
uses: actions/upload-artifact@v4
with:
name: kernel-profile
path: |
build/kernel-profile.json
build/kernel-objects.json
build/kernel-profile.md
if-no-files-found: error

build-system:
runs-on: ubuntu-24.04-arm
steps:
Expand Down
52 changes: 43 additions & 9 deletions .github/workflows/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ jobs:
wait-interval: 20
checks-discovery-timeout: 300

- name: wait for kernel build
uses: lewagon/wait-on-check-action@v1.6.0
with:
ref: ${{ env.SHA }}
check-name: build-kernel
repo-token: ${{ secrets.GITHUB_TOKEN }}
allowed-conclusions: success
wait-interval: 20
checks-discovery-timeout: 300

- name: get build run ID
id: get_run_id
env:
Expand All @@ -47,6 +57,14 @@ jobs:
name: rootfs-profile
path: build/

- name: download kernel profile
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
run_id: ${{ steps.get_run_id.outputs.run_id }}
name: kernel-profile
path: build/

- name: download master baseline
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -56,25 +74,41 @@ jobs:
--status=success --limit=1 --json databaseId --jq '.[0].databaseId')
if [ -n "$RUN_ID" ]; then
gh run download "$RUN_ID" --name rootfs-profile --dir baseline/ || true
gh run download "$RUN_ID" --name kernel-profile --dir baseline/ || true
fi

- name: post PR comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DIFF_MD=$(./vamos profile diff baseline/rootfs-profile.json build/rootfs-profile.json 2>/dev/null || echo "No baseline available")
PROFILE_MD=$(cat build/rootfs-profile.md)
ROOTFS_DIFF_MD=$(./vamos profile diff baseline/rootfs-profile.json build/rootfs-profile.json 2>/dev/null || echo "No baseline available")
ROOTFS_PROFILE_MD=$(cat build/rootfs-profile.md)
KERNEL_DIFF_MD=$(./vamos profile kernel diff baseline/kernel-profile.json build/kernel-profile.json 2>/dev/null || echo "No baseline available")
KERNEL_PROFILE_MD=$(cat build/kernel-profile.md)

printf -v COMMENT_BODY '%s\n%s\n\n%s\n%s\n\n---\n\n%s' \
'<!-- rootfs-profile-bot -->' \
'## vamOS System Profile' \
'### Changes vs master' \
"$DIFF_MD" \
"$PROFILE_MD"
COMMENT_BODY=$(printf '%s\n' \
'<!-- vamos-profile-bot -->' \
'## vamOS Profiles' \
'' \
'### System Changes vs master' \
"$ROOTFS_DIFF_MD" \
'' \
'### Kernel Changes vs master' \
"$KERNEL_DIFF_MD" \
'' \
'---' \
'' \
'## System Profile Details' \
"$ROOTFS_PROFILE_MD" \
'' \
'---' \
'' \
'## Kernel Profile Details' \
"$KERNEL_PROFILE_MD")

COMMENT_ID=$(gh api \
"repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
--jq '.[] | select(.body | contains("<!-- rootfs-profile-bot -->")) | .id' \
--jq '.[] | select(.body | contains("<!-- vamos-profile-bot -->")) | .id' \
| head -1)

if [ -n "$COMMENT_ID" ]; then
Expand Down
1 change: 1 addition & 0 deletions tools/build/Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apk add --no-cache \
findutils \
flex \
git \
jq \
libcap \
linux-headers \
lz4-dev \
Expand Down
4 changes: 4 additions & 0 deletions tools/build/build_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ build_kernel() {
rm -f $BOOT_IMG.nonsecure $BOOT_IMG.sha256 $BOOT_IMG.sig $BOOT_IMG.sig.padded

mv $BOOT_IMG "$OUT_DIR/"

echo "-- Collecting kernel profile --"
bash "$DIR/tools/profile/kernel.sh"

echo "-- Done! boot.img: $OUT_DIR/boot.img --"
ls -lh "$OUT_DIR/boot.img"
}
Expand Down
Loading
Loading