-
Notifications
You must be signed in to change notification settings - Fork 154
164 lines (138 loc) · 4.82 KB
/
Copy pathbuild.yml
File metadata and controls
164 lines (138 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
board: [discoveryf4, discoveryf429, b-l475e-iot01a]
steps:
- uses: actions/checkout@v6
- name: Install ARM toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '15.2.Rel1'
- name: Configure for ${{ matrix.board }}
run: make ${{ matrix.board }}_defconfig
- name: Build kernel
run: make
- name: Show binary size
run: arm-none-eabi-size build/${{ matrix.board }}/f9.elf
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: f9-${{ matrix.board }}
path: |
build/${{ matrix.board }}/f9.elf
build/${{ matrix.board }}/f9.bin
test:
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
app: [tests, posix]
include:
- app: tests
name: "Kernel Test Suite"
config: USER_APP_TESTS
config_extra: ""
- app: posix
name: "POSIX Compliance (PSE51+PSE52)"
config: USER_APP_POSIX
# POSIX test suite is larger; disable symbol map and kprobes
# to fit kernel + user code in 96KB SRAM1.
config_extra: "SYMMAP=n KPROBES=n"
name: test (${{ matrix.app }})
steps:
- uses: actions/checkout@v6
- name: Install ARM toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '15.2.Rel1'
- name: Install QEMU
env:
GH_TOKEN: ${{ github.token }}
QEMU_VERSION: '10.2.2'
run: |
asset="qemu-${QEMU_VERSION}-arm-softmmu-linux-x86_64.tar.gz"
# Try prebuilt binary from GitHub release first, fall back to
# building from source (needed until qemu-build.yml has run once).
dl_err=$(gh release download "qemu-v${QEMU_VERSION}" \
--pattern "$asset" --dir /tmp 2>&1) && dl_ok=1 || dl_ok=0
if [ "$dl_ok" = 1 ]; then
echo "[QEMU] Using prebuilt binary from release"
sudo tar -xzf "/tmp/${asset}" -C /opt
elif echo "$dl_err" | grep -qi "release not found"; then
echo "[QEMU] Release not found, building from source..."
sudo apt-get update
sudo apt-get install -y ninja-build pkg-config libglib2.0-dev libpixman-1-dev
curl -fsSL "https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz" | tar xJ
cd "qemu-${QEMU_VERSION}"
./configure --target-list=arm-softmmu --prefix=/opt/qemu --disable-docs
make -j$(nproc)
sudo make install
cd ..
else
echo "[QEMU] gh release download failed: $dl_err"
exit 1
fi
echo "/opt/qemu/bin" >> "$GITHUB_PATH"
/opt/qemu/bin/qemu-system-arm --version
/opt/qemu/bin/qemu-system-arm -M help | awk '{print $1}' | grep -Fx b-l475e-iot01a
- name: Configure for b-l475e-iot01a with ${{ matrix.name }}
run: |
# Bootstrap Kconfig tools (cloned on demand by make, but we
# need them before the first make invocation here)
make tools/kconfig/kconfiglib.py
cp board/b-l475e-iot01a/defconfig .config
# Enable selected test suite on top of board defaults
python3 tools/kconfig/setconfig.py \
${{ matrix.config }}=y ${{ matrix.config_extra }}
python3 tools/kconfig/genconfig.py --header-path include/autoconf.h Kconfig
- name: Verify configuration
run: |
echo "=== Build Configuration ==="
grep -E "^CONFIG_(QEMU|USER_APP_|BOARD_)" .config | grep "=y"
- name: Build
run: make
- name: Run tests
run: make run-tests
- name: Run MPU fault test
if: matrix.app == 'tests'
run: make run-tests FAULT=mpu
continue-on-error: true # MPU fault test may behave differently under QEMU
- name: Run stack canary fault test
if: matrix.app == 'tests'
run: make run-tests FAULT=canary
compile-hw:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
app: [tests, posix]
include:
- app: tests
config: USER_APP_TESTS
- app: posix
config: USER_APP_POSIX
name: compile-hw (${{ matrix.app }})
steps:
- uses: actions/checkout@v6
- name: Install ARM toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '15.2.Rel1'
- name: Configure for discoveryf4 (hardware target)
run: |
make discoveryf4_defconfig
python3 tools/kconfig/setconfig.py ${{ matrix.config }}=y
python3 tools/kconfig/genconfig.py --header-path include/autoconf.h Kconfig
- name: Build (compile-only, no QEMU)
run: make