Skip to content

Commit a9757a5

Browse files
committed
github/workflows: Add build/publish workflows
This commit ports the build and publish workflows from: Branch: eve-kernel-arm64-v5.15.136-nvidia-jp6 HEAD: dbf1688 Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
1 parent 60710df commit a9757a5

2 files changed

Lines changed: 115 additions & 0 deletions

File tree

.github/workflows/pr-build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: PR Build
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
branches:
6+
- "eve-kernel-arm64-v6.8.12-nvidia-jp7"
7+
paths-ignore:
8+
- ".github/**"
9+
10+
concurrency:
11+
group: pr-build-${{ github.event.pull_request.number }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: [runner-xl, Linux]
17+
18+
steps:
19+
- name: Set sanitized branch name
20+
id: branch-setter
21+
run: |
22+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
23+
SAFE_BRANCH="${BRANCH_NAME//\//-}"
24+
echo "SAFE_BRANCH=$SAFE_BRANCH" >> $GITHUB_ENV
25+
- name: Checkout PR code
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
ref: ${{ github.event.pull_request.head.sha }}
29+
repository: ${{ github.event.pull_request.head.repo.full_name }}
30+
fetch-depth: 1
31+
32+
- name: Build kernel
33+
run: |
34+
make -f Makefile.eve \
35+
BRANCH=$SAFE_BRANCH \
36+
kernel-gcc
37+
38+
- name: Clean
39+
if: always()
40+
run: |
41+
make -f Makefile.eve \
42+
BRANCH=$SAFE_BRANCH \
43+
clean-gcc
44+
if docker ps -q -f name=linuxkit-builder | grep -q .; then
45+
echo "=== BuildKit disk usage before prune ==="
46+
docker exec linuxkit-builder buildctl du | tail -n 2
47+
echo "=== Reclaiming ==="
48+
docker exec linuxkit-builder buildctl prune --keep-storage "${BUILDKIT_KEEP_STORAGE_MB:-32000}" | tail -n 1
49+
echo "=== BuildKit disk usage after prune ==="
50+
docker exec linuxkit-builder buildctl du | tail -n 2
51+
else
52+
echo "linuxkit-builder container not running; skipping BuildKit cleanup."
53+
fi

.github/workflows/publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Building and pushing Eve kernel images
2+
3+
on:
4+
push:
5+
branches:
6+
- "eve-kernel-arm64-v6.8.12-nvidia-jp7"
7+
8+
concurrency:
9+
group: main-build-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
runs-on: [runner-xl, Linux]
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
ref: ${{ github.ref }}
21+
fetch-depth: 1
22+
23+
- name: Login to Docker Hub (pull)
24+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
25+
with:
26+
username: ${{ secrets.DOCKERHUB_PULL_USER }}
27+
password: ${{ secrets.DOCKERHUB_PULL_TOKEN }}
28+
29+
- name: Build kernel from ${{ github.ref_name }}
30+
run: |
31+
make -f Makefile.eve \
32+
BRANCH=${{ github.ref_name }} \
33+
kernel-gcc
34+
35+
- name: Login to Docker Hub (push)
36+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
37+
with:
38+
username: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }}
39+
password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
40+
41+
- name: Push from ${{ github.ref_name }}
42+
run: |
43+
make -f Makefile.eve \
44+
BRANCH=${{ github.ref_name }} \
45+
push-gcc
46+
47+
- name: Clean
48+
if: always()
49+
run: |
50+
make -f Makefile.eve \
51+
BRANCH=${{ github.ref_name }} \
52+
clean-gcc
53+
if docker ps -q -f name=linuxkit-builder | grep -q .; then
54+
echo "=== BuildKit disk usage before prune ==="
55+
docker exec linuxkit-builder buildctl du | tail -n 2
56+
echo "=== Reclaiming ==="
57+
docker exec linuxkit-builder buildctl prune --keep-storage "${BUILDKIT_KEEP_STORAGE_MB:-32000}" | tail -n 1
58+
echo "=== BuildKit disk usage after prune ==="
59+
docker exec linuxkit-builder buildctl du | tail -n 2
60+
else
61+
echo "linuxkit-builder container not running; skipping BuildKit cleanup."
62+
fi

0 commit comments

Comments
 (0)