-
Notifications
You must be signed in to change notification settings - Fork 40
173 lines (139 loc) · 4.55 KB
/
Copy pathbuild.yml
File metadata and controls
173 lines (139 loc) · 4.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- '*-bpi'
- '*-ci'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
UBOOT_BRANCH: ${{ github.head_ref || github.ref_name }}
ATF_BRANCH: mtk-atf-2026
strategy:
fail-fast: false
matrix:
include:
- board: bpi-r2
boots: "sdmmc"
atf: false
ram8g: false
- board: bpi-r64
boots: "sdmmc emmc"
atf: true
ram8g: false
- board: bpi-r2pro
boots: "sdmmc"
atf: false
ram8g: false
- board: bpi-r3
boots: "sdmmc emmc spi-nand spi-nor"
atf: true
ram8g: false
- board: bpi-r3mini
boots: "emmc spi-nand"
atf: true
ram8g: false
- board: bpi-r4
boots: "sdmmc emmc spi-nand"
atf: true
ram8g: true
- board: bpi-r4lite
boots: "sdmmc emmc spi-nand"
atf: true
ram8g: false
- board: bpi-r4pro
boots: "sdmmc emmc spi-nand"
atf: true
ram8g: true
steps:
- uses: actions/checkout@v4
- name: Setup env
run: |
echo "DT=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_ENV
echo "UBOOTVER=$(make ubootversion)" >> $GITHUB_ENV
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Print env
run: |
echo $BRANCH $UBOOTVER $DT
# ccache restore
- name: Restore ccache
uses: actions/cache@v4
with:
path: .cache/ccache
key: ccache-${{ matrix.board }}-${{ github.ref_name }}
restore-keys: |
ccache-${{ matrix.board }}-
ccache-
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y \
ccache libssl-dev u-boot-tools \
gcc-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
make python3-pyelftools
- name: Fetch mtk-atf branch
if: matrix.atf == true
run: |
git fetch origin $ATF_BRANCH --depth=1
- name: Build
run: |
set -e
for boot in ${{ matrix.boots }}; do
echo "===================================="
echo "Building ${{ matrix.board }} for $boot"
echo "===================================="
git checkout $UBOOT_BRANCH
echo -e "board=${{ matrix.board }}\ndevice=$boot" > build.conf
bash build.sh importconfig
bash build.sh build
bash build.sh rename
# ATF builds (optional)
if [ "${{ matrix.atf }}" = "true" ]; then
git checkout build.conf
echo "---- ATF build for $boot ----"
git checkout $ATF_BRANCH
echo -e "board=${{ matrix.board }}\ndevice=$boot" > build.conf
# normal ATF build
bash build.sh build
bash build.sh rename
if [[ "$boot" == *"mmc"* ]]; then
bash build.sh createimg non-interactive
fi
if [ "${{ matrix.ram8g }}" == "true" ]; then
echo "extraflags=DDR4_4BG_MODE=1" >> build.conf
bash build.sh build
bash build.sh rename
fi
# optional: special NAND/UBI case
if [[ "$boot" == *"nand"* ]]; then
echo "extraflags=UBI=1" >> build.conf
bash build.sh build
bash build.sh rename
if [ "${{ matrix.ram8g }}" == "true" ]; then
echo "extraflags=UBI=1 DDR4_4BG_MODE=1" >> build.conf
bash build.sh build
bash build.sh rename
fi
fi
rm -f build.conf
else
bash build.sh createimg non-interactive
git checkout build.conf
fi
done
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: uboot-${{ matrix.board }}
path: |
${{ matrix.board }}*_fip.bin
u-boot-${{ matrix.board }}_*.bin
${{ matrix.board }}*_bl2.img
${{ matrix.board }}_*.img.gz