Skip to content

Commit c366f84

Browse files
Add CI test for eboot build (#7546)
Check that building the eboot.c block generates the same binary as the verison checked into the repo. Catches the case where a library or eboot.c file is changed, but an updated eboot.elf isn't included in a PR. Can't do simple binary diff of the ELFs because paths and compile times will change, so dump the two sections we care about.
1 parent 53e4dec commit c366f84

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/pull-request.yml

+7
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,16 @@ jobs:
251251
- uses: actions/setup-python@v2
252252
with:
253253
python-version: '3.x'
254+
- name: Cache Linux toolchain
255+
id: cache-linux
256+
uses: actions/cache@v2
257+
with:
258+
path: ./tools/dist
259+
key: key-linux-toolchain
254260
- name: Boards.txt diff
255261
env:
256262
TRAVIS_BUILD_DIR: ${{ github.workspace }}
257263
TRAVIS_TAG: ${{ github.ref }}
258264
run: |
259265
bash ./tests/ci/build_boards.sh
266+
bash ./tests/ci/eboot_test.sh

tests/ci/eboot_test.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
READELF="$TRAVIS_BUILD_DIR/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-readelf"
4+
5+
set -ev
6+
7+
cd $TRAVIS_BUILD_DIR/tools
8+
python3 get.py -q
9+
10+
cd $TRAVIS_BUILD_DIR/bootloaders/eboot
11+
12+
"$READELF" -x .data -x .text eboot.elf > git.txt
13+
make clean
14+
make
15+
"$READELF" -x .data -x .text eboot.elf > build.txt
16+
diff git.txt build.txt
17+
if [ $? -ne 0 ]; then
18+
echo ERROR: eboot.elf in repo does not match output from compile.
19+
echo ERROR: Need to rebuild and check in updated eboot.
20+
exit 1
21+
fi

0 commit comments

Comments
 (0)