Skip to content

Commit f669d2e

Browse files
committed
CI-tests: STM32L4 and STM32WB using CubeMX SDK
1 parent 5ea3de1 commit f669d2e

File tree

2 files changed

+119
-12
lines changed

2 files changed

+119
-12
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Wolfboot Reusable Build Workflow for STM32Cube SDK
2+
3+
on:
4+
5+
workflow_call:
6+
inputs:
7+
arch:
8+
required: true
9+
type: string
10+
config-file:
11+
required: true
12+
type: string
13+
cube-repo:
14+
description: 'STM32Cube repository to clone (e.g., STMicroelectronics/STM32CubeL4)'
15+
required: true
16+
type: string
17+
make-args:
18+
required: false
19+
type: string
20+
21+
jobs:
22+
23+
build:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 30
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
submodules: true
31+
32+
- uses: actions/checkout@v4
33+
with:
34+
repository: ${{inputs.cube-repo}}
35+
path: STM32Cube
36+
37+
- name: Workaround for sources.list
38+
run: |
39+
# Replace sources
40+
41+
set -euxo pipefail
42+
43+
# Peek (what repos are active now)
44+
apt-cache policy
45+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
46+
47+
# Enable nullglob so *.list/*.sources that don't exist don't break sed
48+
shopt -s nullglob
49+
50+
echo "Replace sources.list (legacy)"
51+
sudo sed -i \
52+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
53+
/etc/apt/sources.list || true
54+
55+
echo "Replace sources.list.d/*.list (legacy)"
56+
for f in /etc/apt/sources.list.d/*.list; do
57+
sudo sed -i \
58+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
59+
"$f"
60+
done
61+
62+
echo "Replace sources.list.d/*.sources (deb822)"
63+
for f in /etc/apt/sources.list.d/*.sources; do
64+
sudo sed -i \
65+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
66+
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
67+
"$f"
68+
done
69+
70+
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
71+
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
72+
# Replace azure with our mirror (idempotent)
73+
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
74+
fi
75+
76+
# Peek (verify changes)
77+
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
78+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
79+
echo "--- apt-mirrors.txt ---"
80+
cat /etc/apt/apt-mirrors.txt || true
81+
82+
- name: Update repository
83+
run: sudo apt-get update
84+
85+
- name: Install cross compilers
86+
run: |
87+
sudo apt-get install -y gcc-arm-none-eabi
88+
89+
- name: make distclean
90+
run: |
91+
make distclean
92+
93+
- name: Select config
94+
run: |
95+
cp ${{inputs.config-file}} .config && make include/target.h
96+
97+
- name: Build tools
98+
run: |
99+
make -C tools/keytools && make -C tools/bin-assemble
100+
101+
- name: Build wolfboot
102+
run: |
103+
make STM32CUBE="$GITHUB_WORKSPACE/STM32Cube" ${{inputs.make-args}} V=1
104+

.github/workflows/test-configs.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,12 @@ jobs:
375375
arch: arm
376376
config-file: ./config/examples/stm32l0.config
377377

378-
# TODO: stm32l4-cube.config requires Cube HAL
379-
# stm32l4_cube_test:
380-
# uses: ./.github/workflows/test-build.yml
381-
# with:
382-
# arch: arm
383-
# config-file: ./config/examples/stm32l4-cube.config
378+
stm32l4_cube_test:
379+
uses: ./.github/workflows/test-build-stm32cube.yml
380+
with:
381+
arch: arm
382+
config-file: ./config/examples/stm32l4-cube.config
383+
cube-repo: STMicroelectronics/STM32CubeL4
384384

385385
stm32l5_nonsecure_dualbank_test:
386386
uses: ./.github/workflows/test-build.yml
@@ -436,12 +436,15 @@ jobs:
436436
arch: arm
437437
config-file: ./config/examples/stm32wb-delta.config
438438

439-
# TODO: stm32wb-pka-1mb.config requires STM32 HAL #include "stm32wbxx_hal.h
440-
# stm32wb_pka_1mb_test:
441-
# uses: ./.github/workflows/test-build.yml
442-
# with:
443-
# arch: arm
444-
# config-file: ./config/examples/stm32wb-pka-1mb.config
439+
# NOTE: PKA=1 test may fail until wolfSSL fix is merged:
440+
# https://github.com/wolfSSL/wolfssl/pull/9446
441+
stm32wb_pka_1mb_test:
442+
uses: ./.github/workflows/test-build-stm32cube.yml
443+
with:
444+
arch: arm
445+
config-file: ./config/examples/stm32wb-pka-1mb.config
446+
cube-repo: STMicroelectronics/STM32CubeWB
447+
make-args: PKA=1 NO_ARM_ASM=1
445448

446449
stm32wb_tpm_test:
447450
uses: ./.github/workflows/test-build.yml

0 commit comments

Comments
 (0)