|
22 | 22 | - 'scripts/swarm_presets/**' |
23 | 23 | - '.github/workflows/firmware-qemu.yml' |
24 | 24 |
|
| 25 | +defaults: |
| 26 | + run: |
| 27 | + shell: bash |
| 28 | + |
25 | 29 | env: |
26 | 30 | IDF_VERSION: "v5.4" |
27 | | - QEMU_REPO: "https://github.com/espressif/qemu.git" |
28 | | - QEMU_BRANCH: "esp-develop" |
29 | 31 |
|
30 | 32 | jobs: |
31 | 33 | build-qemu: |
32 | 34 | name: Build Espressif QEMU |
33 | | - # QEMU's bundled dtc fails with GCC 15 on Ubuntu 26.04. Keep the |
34 | | - # Ubuntu 24.04 / GCC 13 build environment until that dependency is updated. |
35 | 35 | runs-on: ubuntu-24.04 |
| 36 | + # This SDK image installs Espressif's checksum-verified QEMU package and |
| 37 | + # its runtime libraries. Match the image used by both consumers below. |
| 38 | + # Avoid APT DNS and an unpinned floating QEMU source build on cold caches. |
| 39 | + container: |
| 40 | + image: espressif/idf:v5.4@sha256:f1e9f69dc052b9afc7801ca884e0ef40c17e014bb05ce73d9c09d29290bd17fb |
36 | 41 | steps: |
37 | | - - name: Cache QEMU build |
38 | | - id: cache-qemu |
39 | | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 |
40 | | - with: |
41 | | - path: /opt/qemu-esp32 |
42 | | - # Scope native binaries to the build image; bump v1 when refreshing |
43 | | - # the floating upstream branch. Do not restore an unqualified cache. |
44 | | - key: qemu-esp32s3-ubuntu-24.04-${{ env.QEMU_BRANCH }}-v1 |
45 | | - |
46 | | - - name: Install QEMU build dependencies |
47 | | - if: steps.cache-qemu.outputs.cache-hit != 'true' |
48 | | - run: | |
49 | | - sudo apt-get update |
50 | | - sudo apt-get install -y \ |
51 | | - git build-essential ninja-build pkg-config \ |
52 | | - libglib2.0-dev libpixman-1-dev libslirp-dev \ |
53 | | - libgcrypt20-dev \ |
54 | | - python3 python3-venv |
55 | | -
|
56 | | - - name: Clone and build Espressif QEMU |
57 | | - if: steps.cache-qemu.outputs.cache-hit != 'true' |
| 42 | + - name: Prepare SDK-provided Espressif QEMU |
58 | 43 | run: | |
59 | | - git clone --depth 1 -b "$QEMU_BRANCH" "$QEMU_REPO" /tmp/qemu-esp |
60 | | - cd /tmp/qemu-esp |
61 | | - mkdir build && cd build |
62 | | - ../configure \ |
63 | | - --target-list=xtensa-softmmu \ |
64 | | - --prefix=/opt/qemu-esp32 \ |
65 | | - --enable-slirp \ |
66 | | - --disable-werror |
67 | | - ninja -j$(nproc) |
68 | | - ninja install |
| 44 | + . "$IDF_PATH/export.sh" |
| 45 | + QEMU_BIN="$(command -v qemu-system-xtensa)" |
| 46 | + QEMU_ROOT="$(dirname "$(dirname "$QEMU_BIN")")" |
| 47 | + "$QEMU_BIN" --version |
| 48 | + "$QEMU_BIN" -machine help | grep -E '^esp32s3[[:space:]]' |
| 49 | + mkdir -p /opt/qemu-esp32 |
| 50 | + cp -a "$QEMU_ROOT/." /opt/qemu-esp32/ |
69 | 51 |
|
70 | 52 | - name: Verify QEMU binary |
71 | 53 | run: | |
|
85 | 67 | needs: build-qemu |
86 | 68 | runs-on: ubuntu-latest |
87 | 69 | container: |
88 | | - image: espressif/idf:v5.4 |
| 70 | + image: espressif/idf:v5.4@sha256:f1e9f69dc052b9afc7801ca884e0ef40c17e014bb05ce73d9c09d29290bd17fb |
89 | 71 |
|
90 | 72 | strategy: |
91 | 73 | fail-fast: false |
@@ -214,32 +196,35 @@ jobs: |
214 | 196 |
|
215 | 197 | fuzz-test: |
216 | 198 | name: Fuzz Testing (ADR-061 Layer 6) |
217 | | - runs-on: ubuntu-latest |
| 199 | + runs-on: ubuntu-24.04 |
| 200 | + env: |
| 201 | + CC: clang-18 |
218 | 202 | steps: |
219 | 203 | - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 |
220 | 204 | with: |
221 | 205 | submodules: recursive |
222 | 206 |
|
223 | | - - name: Install clang |
| 207 | + - name: Verify hosted Clang |
| 208 | + # Ubuntu 24.04 hosted runners already contain Clang 18 and libFuzzer. |
| 209 | + # Do not fetch the redundant distro meta-package before testing. |
224 | 210 | run: | |
225 | | - sudo apt-get update |
226 | | - sudo apt-get install -y clang |
| 211 | + "$CC" --version |
227 | 212 |
|
228 | 213 | - name: Build fuzz targets |
229 | 214 | working-directory: firmware/esp32-csi-node/test |
230 | | - run: make all CC=clang |
| 215 | + run: make all CC="$CC" |
231 | 216 |
|
232 | 217 | - name: Run serialize fuzzer (60s) |
233 | 218 | working-directory: firmware/esp32-csi-node/test |
234 | | - run: make run_serialize FUZZ_DURATION=60 || echo "FUZZER_CRASH=serialize" >> "$GITHUB_ENV" |
| 219 | + run: make run_serialize CC="$CC" FUZZ_DURATION=60 || echo "FUZZER_CRASH=serialize" >> "$GITHUB_ENV" |
235 | 220 |
|
236 | 221 | - name: Run edge enqueue fuzzer (60s) |
237 | 222 | working-directory: firmware/esp32-csi-node/test |
238 | | - run: make run_edge FUZZ_DURATION=60 || echo "FUZZER_CRASH=edge" >> "$GITHUB_ENV" |
| 223 | + run: make run_edge CC="$CC" FUZZ_DURATION=60 || echo "FUZZER_CRASH=edge" >> "$GITHUB_ENV" |
239 | 224 |
|
240 | 225 | - name: Run NVS config fuzzer (60s) |
241 | 226 | working-directory: firmware/esp32-csi-node/test |
242 | | - run: make run_nvs FUZZ_DURATION=60 || echo "FUZZER_CRASH=nvs" >> "$GITHUB_ENV" |
| 227 | + run: make run_nvs CC="$CC" FUZZ_DURATION=60 || echo "FUZZER_CRASH=nvs" >> "$GITHUB_ENV" |
243 | 228 |
|
244 | 229 | - name: Check for crashes |
245 | 230 | working-directory: firmware/esp32-csi-node/test |
@@ -320,7 +305,7 @@ jobs: |
320 | 305 | needs: [build-qemu] |
321 | 306 | runs-on: ubuntu-latest |
322 | 307 | container: |
323 | | - image: espressif/idf:v5.4 |
| 308 | + image: espressif/idf:v5.4@sha256:f1e9f69dc052b9afc7801ca884e0ef40c17e014bb05ce73d9c09d29290bd17fb |
324 | 309 |
|
325 | 310 | steps: |
326 | 311 | - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 |
|
0 commit comments