Skip to content

Commit 7078dba

Browse files
committed
ci: try with temporary file
1 parent 1addf6a commit 7078dba

1 file changed

Lines changed: 34 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,33 @@ jobs:
9696
- name: Init build helpers
9797
shell: bash
9898
run: |
99+
cat > build_helpers.sh <<'EOF'
99100
build_boot() {
100101
BOOT="$1"
101102
set -euo pipefail
102103
103-
echo "::group::${boot}"
104+
echo "::group::${BOOT}"
104105
echo "===================================="
105106
echo "Building ${BOARD} for ${BOOT}"
106107
echo "===================================="
107108
108109
git checkout $UBOOT_BRANCH
109110
110-
echo "board=${{ matrix.board }}\ndevice=${BOOT}\n" > build.conf
111+
echo "board=${BOARD}\ndevice=${BOOT}\n" > build.conf
112+
cat build.conf
111113
112114
bash build.sh importconfig
113115
bash build.sh build
114116
bash build.sh rename
115117
116118
# ATF builds (optional)
117-
if [ "${{ matrix.atf }}" = "true" ]; then
119+
if [ "${ATF}" = "true" ]; then
118120
git checkout build.conf
119121
echo "---- ATF build for ${BOOT} ----"
120122
121123
git checkout $ATF_BRANCH
122124
123-
echo -e "board=${{ matrix.board }}\ndevice=${BOOT}" > build.conf
125+
echo -e "board=${BOARD}\ndevice=${BOOT}" > build.conf
124126
125127
# normal ATF build
126128
bash build.sh build
@@ -130,7 +132,7 @@ jobs:
130132
bash build.sh createimg non-interactive
131133
fi
132134
133-
if [ "${{ matrix.ram8g }}" == "true" ]; then
135+
if [ "${RAM8G}" == "true" ]; then
134136
echo "extraflags=DDR4_4BG_MODE=1" >> build.conf
135137
bash build.sh build
136138
bash build.sh rename
@@ -142,7 +144,7 @@ jobs:
142144
bash build.sh build
143145
bash build.sh rename
144146
145-
if [ "${{ matrix.ram8g }}" == "true" ]; then
147+
if [ "${RAM8G}" == "true" ]; then
146148
echo "extraflags=UBI=1 DDR4_4BG_MODE=1" >> build.conf
147149
bash build.sh build
148150
bash build.sh rename
@@ -160,37 +162,62 @@ jobs:
160162
fi
161163
echo "::endgroup::"
162164
}
163-
export -f build_boot
165+
EOF
164166
165167
- name: Build sdmmc
166168
if: contains(matrix.boots, 'sdmmc')
167169
shell: bash
168170
run: |
171+
source build_helpers.sh
169172
build_boot sdmmc
173+
env:
174+
BOARD: ${{ matrix.board }}
175+
ATF: ${{ matrix.atf }}
176+
RAM8G: ${{ matrix.ram8g }}
170177

171178
- name: Build emmc
172179
if: contains(matrix.boots, 'emmc')
173180
shell: bash
174181
run: |
182+
source build_helpers.sh
175183
build_boot emmc
184+
env:
185+
BOARD: ${{ matrix.board }}
186+
ATF: ${{ matrix.atf }}
187+
RAM8G: ${{ matrix.ram8g }}
176188

177189
- name: Build spi-nand
178190
if: contains(matrix.boots, 'spi-nand')
179191
shell: bash
180192
run: |
193+
source build_helpers.sh
181194
build_boot spi-nand
195+
env:
196+
BOARD: ${{ matrix.board }}
197+
ATF: ${{ matrix.atf }}
198+
RAM8G: ${{ matrix.ram8g }}
182199

183200
- name: Build spi-nor
184201
if: contains(matrix.boots, 'spi-nor')
185202
shell: bash
186203
run: |
204+
source build_helpers.sh
187205
build_boot spi-nor
206+
env:
207+
BOARD: ${{ matrix.board }}
208+
ATF: ${{ matrix.atf }}
209+
RAM8G: ${{ matrix.ram8g }}
188210

189211
- name: Build ram
190212
if: contains(matrix.boots, 'ram')
191213
shell: bash
192214
run: |
215+
source build_helpers.sh
193216
build_boot ram
217+
env:
218+
BOARD: ${{ matrix.board }}
219+
ATF: ${{ matrix.atf }}
220+
RAM8G: ${{ matrix.ram8g }}
194221

195222
- name: Upload artifacts
196223
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)