Skip to content

Commit 1ad66e9

Browse files
committed
Improve docs, add targets and tests per #598 (review)
1 parent 8b91362 commit 1ad66e9

18 files changed

+1222
-314
lines changed

.github/workflows/test-build-cmake-dot-config.yml

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,30 @@ on:
77

88
jobs:
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:
@@ -60,7 +81,6 @@ jobs:
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

.github/workflows/test-build-cmake-mac.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ 'master', 'main', 'release/**' ]
66
pull_request:
7-
branches: [ '*' ]
7+
branches: [ "*" ]
88

99
jobs:
1010
macos-cmake:
@@ -15,7 +15,20 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
target: [stm32l4, stm32h7, stm32c0, stm32g0]
18+
target:
19+
# - imx-rt # Disabled, requires NXP SDK
20+
- stm32c0
21+
- stm32f1
22+
- stm32f4
23+
- stm32f7
24+
- stm32g0
25+
- stm32h5
26+
- stm32h7
27+
- stm32l0
28+
- stm32l4
29+
- stm32l5
30+
- stm32u5
31+
- stm32wb
1932

2033
env:
2134
HOMEBREW_NO_AUTO_UPDATE: "1" # avoid updating taps during install

.github/workflows/test-build-cmake-presets.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: WolfBoot CMake Presets Build
22

33
on:
44
push:
5-
# TODO: branches: [ 'master', 'main', 'release/**' ]
5+
branches: [ 'master', 'main', 'release/**' ]
66
branches: [ '*' ]
77
pull_request:
88
branches: [ "*" ]
@@ -23,9 +23,21 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
target:
26-
- stm32l4
27-
- stm32h7
26+
- sim
27+
# - imx-rt # Disabled, requires NXP SDK
28+
- stm32c0
29+
- stm32f1
30+
- stm32f4
31+
- stm32f7
2832
- stm32g0
33+
- stm32h5
34+
- stm32h7
35+
- stm32l0
36+
- stm32l4
37+
- stm32l5
38+
- stm32u5
39+
- stm32wb
40+
2941
include:
3042
# Optional per-target cache variables you might want to pass later.
3143
# Keep empty for now to avoid guessing addresses.
@@ -48,6 +60,7 @@ jobs:
4860

4961
# ARM GCC toolchain (adds the bin dir to PATH)
5062
- name: Set up ARM none-eabi GCC 14.x
63+
if: matrix.target != 'sim'
5164
uses: carlosperate/arm-none-eabi-gcc-action@v1
5265
with:
5366
release: "14.2.Rel1" # <-- use 'release', not 'version'

.github/workflows/test-build-cmake-script.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
1+
# Tests the /tools/scripts/wolfboot_cmake_full_build.sh
2+
# See also test-build-cmake-presets.yml
3+
# Presets are found in /CMakePresets.json
4+
#
15
name: wolfboot CMake Script
26
on:
37
push:
48
branches: [ 'master', 'main', 'release/**' ]
59
pull_request:
6-
branches: [ '*' ]
10+
branches: [ "*" ]
11+
712
jobs:
813
wolfboot_build_script_test:
14+
name: Build wolfBoot (target=${{ matrix.target }})
915
runs-on: ubuntu-latest
1016
timeout-minutes: 15
1117

18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
target:
22+
- "~No config (wolfBoot sim)"
23+
# - imx-rt # Disabled, requires NXP SDK
24+
- stm32c0
25+
- stm32f1
26+
- stm32f4
27+
- stm32f7
28+
- stm32g0
29+
- stm32h5
30+
- stm32h7
31+
- stm32l0
32+
- stm32l4
33+
- stm32l5
34+
- stm32u5
35+
- stm32wb
36+
# add more targets here later, e.g.:
37+
# - stm32v8
38+
# - sim options, etc
39+
1240
steps:
1341
- uses: actions/checkout@v4
1442
with:
@@ -59,19 +87,23 @@ jobs:
5987
echo "--- apt-mirrors.txt ---"
6088
cat /etc/apt/apt-mirrors.txt || true
6189
62-
6390
- name: Install requirements
6491
run: |
6592
sudo apt-get update
6693
sudo apt-get install -y gcc-arm-none-eabi gcc-powerpc-linux-gnu cmake
6794
68-
- name: Run wolfboot_build script
95+
- name: View Presets
6996
run: |
70-
rm -rf ./build
97+
# Use CMake to list all presets defined in CMakePresets.json
98+
echo "All presets:"
99+
cmake -S . -B build --list-presets=configure
100+
71101
chmod +x ./tools/scripts/wolfboot_cmake_full_build.sh
72102
73-
./tools/scripts/wolfboot_cmake_full_build.sh --CLEAN "stm32l4"
74-
./tools/scripts/wolfboot_cmake_full_build.sh --target "stm32l4"
103+
- name: Run wolfboot_cmake_full_build script
104+
run: |
105+
rm -rf ./build
106+
rm -rf ./build-"${{ matrix.target }}"
75107
76-
./tools/scripts/wolfboot_cmake_full_build.sh --CLEAN "stm32g0"
77-
./tools/scripts/wolfboot_cmake_full_build.sh --target "stm32g0"
108+
./tools/scripts/wolfboot_cmake_full_build.sh --CLEAN "${{ matrix.target }}"
109+
./tools/scripts/wolfboot_cmake_full_build.sh --target "${{ matrix.target }}"

.github/workflows/test-build-cmake-windows.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ 'master', 'main', 'release/**' ]
66
pull_request:
7-
branches: [ '*' ]
7+
branches: [ "*" ]
88

99
permissions:
1010
contents: read
@@ -20,9 +20,20 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
target:
23-
- stm32l4
24-
- stm32h7
23+
# - imx-rt # Disabled, requires NXP SDK
24+
- stm32c0
25+
- stm32f1
26+
- stm32f4
27+
- stm32f7
2528
- stm32g0
29+
- stm32h5
30+
- stm32h7
31+
- stm32l0
32+
- stm32l4
33+
- stm32l5
34+
- stm32u5
35+
- stm32wb
36+
2637
include:
2738
# Optional per-target cache variables you might want to pass later.
2839
# Keep empty for now to avoid guessing addresses.

0 commit comments

Comments
 (0)