Skip to content

Commit 7a6945f

Browse files
committed
.github: add workflow for builds
Signed-off-by: Ozan Durgut <[email protected]>
1 parent b5303e5 commit 7a6945f

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/build.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build ADI br2-external
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
BR2_DL_DIR: $HOME/.buildroot-dl
9+
CC: gcc-15
10+
CXX: g++-15
11+
12+
jobs:
13+
build:
14+
runs-on: self-hosted
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
defconfig:
20+
- adi_sc598_ezkit_defconfig
21+
22+
steps:
23+
- name: Checkout br2-external
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
28+
- name: Prepare Buildroot download dir
29+
run: mkdir -p "$BR2_DL_DIR"
30+
31+
- name: Cache Buildroot downloads
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ env.BR2_DL_DIR }}
35+
key: ${{ runner.os }}-buildroot-dl-${{ hashFiles('configs/**/*.fragment', 'configs/**/*.defconfig') }}
36+
restore-keys: |
37+
${{ runner.os }}-buildroot-dl-
38+
39+
- name: Build image for ${{ matrix.defconfig }}
40+
run: |
41+
cd buildroot
42+
43+
echo ">>> Selecting defconfig: ${{ matrix.defconfig }}"
44+
45+
make BR2_EXTERNAL="${GITHUB_WORKSPACE}" ${{ matrix.defconfig }}
46+
47+
if [ -f "${GITHUB_WORKSPACE}/configs/buildroot.fragment" ] || \
48+
[ -f "${GITHUB_WORKSPACE}/configs/debug.fragment" ]; then
49+
support/kconfig/merge_config.sh .config \
50+
"${GITHUB_WORKSPACE}/configs/buildroot.fragment" \
51+
"${GITHUB_WORKSPACE}/configs/debug.fragment"
52+
fi
53+
54+
make -j$(nproc)
55+
56+
- name: Upload Buildroot images for ${{ matrix.defconfig }}
57+
if: success()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: images-${{ matrix.defconfig }}
61+
path: buildroot/output/images
62+
63+
- name: Upload logs for ${{ matrix.defconfig }} (failure only)
64+
if: failure()
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: logs-${{ matrix.defconfig }}
68+
path: buildroot/output/build

0 commit comments

Comments
 (0)