77
88jobs :
99 wolfboot_dot_config_test :
10+ name : cmake .config test (${{ matrix.target }})
1011 runs-on : ubuntu-latest
1112 timeout-minutes : 15
1213
14+ strategy :
15+ fail-fast : false
16+ matrix :
17+ target :
18+ # These are exact file names from config/examples (including .config)
19+ # - imx-rt1040.config # Disabled, requires NXP SDK
20+ - sim.config
21+ - stm32c0.config
22+ - stm32f1.config
23+ - stm32f4-small-blocks-uart-update.config
24+ - stm32f7.config
25+ - stm32g0.config
26+ - stm32h5.config
27+ - stm32h7.config
28+ - stm32l0.config
29+ - stm32l4-cube.config
30+ - stm32l5.config
31+ - stm32u5.config
32+ - stm32wb.config
33+
1334 steps :
1435 - uses : actions/checkout@v4
1536 with :
6081 echo "--- apt-mirrors.txt ---"
6182 cat /etc/apt/apt-mirrors.txt || true
6283
63-
6484 - name : Install requirements
6585 run : |
6686 # Run system updates and install toolchain
@@ -73,31 +93,59 @@ jobs:
7393
7494 set -euo pipefail
7595
76- LOG_FILE="run.log"
96+ TARGET="${{ matrix.target }}"
97+ TARGET="${TARGET%.config}"
98+ TARGET="${TARGET%%-*}"
99+
100+ BUILD_DIR="build-${TARGET}"
101+ LOG_FILE="run-${TARGET}.log"
77102 KEYWORD="Config mode: dot"
78- echo "Saving output to $LOG_FILE"
79103
80- echo "Fetch stm32h7 example .config"
81- cp ./config/examples/stm32h7.config ./.config
82- ls .config
83- cat .config
104+ echo "Target: ${TARGET}"
105+ echo "Build dir: ${BUILD_DIR}"
106+ echo "Saving output to ${LOG_FILE}"
107+
108+ CONFIG_SRC="./config/examples/${{ matrix.target }}"
109+
110+ echo "Fetch ${TARGET} example .config (source: ${CONFIG_SRC})"
111+ if [ ! -f "${CONFIG_SRC}" ]; then
112+ echo "Missing config file: ${CONFIG_SRC}" >&2
113+ exit 1
114+ fi
115+
116+ cp "${CONFIG_SRC}" ./.config
117+ ls .config
118+ cat .config
84119 echo ""
85120
86121 echo "Clean"
87- rm -rf ./build-stm32h7
122+ rm -rf "./${BUILD_DIR}"
88123
89124 # Here we should see the .config file values read and displayed:
90- cmake -S . -B build-stm32h7 \
91- -DUSE_DOT_CONFIG=ON \
92- -DWOLFBOOT_TARGET=stm32h7 2>&1 | tee "$LOG_FILE"
125+ cmake -S . -B "${BUILD_DIR}" \
126+ -DUSE_DOT_CONFIG=ON \
127+ -DWOLFBOOT_TARGET="${TARGET}" 2>&1 | tee "${ LOG_FILE} "
93128
94129 # Config dot-config mode
95- if grep -q -- "$KEYWORD" "$LOG_FILE"; then
96- echo "Keyword found: $KEYWORD"
130+ if grep -q -- "${ KEYWORD} " "${ LOG_FILE} "; then
131+ echo "Keyword found: ${ KEYWORD} "
97132 else
98- echo "Keyword not found: $KEYWORD" >&2
133+ echo "Keyword not found: ${ KEYWORD} " >&2
99134 exit 1
100135 fi
101136
102- # Sample build
103- cmake --build build-stm32h7 --parallel 8
137+ # First: build keygen explicitly and inspect it
138+ echo "Building keygen_build for ${TARGET}"
139+ cmake --build "${BUILD_DIR}" --parallel 1 --target keygen_build
140+
141+ if [ -f "${BUILD_DIR}/keygen" ]; then
142+ echo "Inspecting keygen:"
143+ ls -l "${BUILD_DIR}/keygen"
144+ file "${BUILD_DIR}/keygen" || true
145+ else
146+ echo "keygen not found at ${BUILD_DIR}/keygen"
147+ fi
148+
149+ # Now run the normal build
150+ echo "Running full build"
151+ cmake --build "${BUILD_DIR}" --parallel 8
0 commit comments