From 8600c5e811154ec5600f08b393b709cb264d970e Mon Sep 17 00:00:00 2001 From: cjkas Date: Thu, 29 Oct 2026 18:53:45 +0100 Subject: [PATCH] ci: attach each board's firmware ELF to releases A crash log on a release build couldn't be decoded: the release had only the .bin files, and the ELF was a 5-day CI artifact of other runs. The panic in #31 names "ELF file SHA256: f85f409205c11d1b" and no copy of that file exists. Each release now gets SomfyController.ino..elf.zip, built in the same job as the .bin it decodes. Beside the ELF is its .sha256: the .bin embeds that hash, and the panic prints its first digits, so a log shows which build it came from. The bug report form asks for the whole panic and says how to decode it. Co-Authored-By: Claude Opus 5.5 --- .github/ISSUE_TEMPLATE/BUG-REPORT.yaml | 7 ++++++- .github/workflows/build.yaml | 27 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/BUG-REPORT.yaml b/.github/ISSUE_TEMPLATE/BUG-REPORT.yaml index 3ba0e4d..0889781 100644 --- a/.github/ISSUE_TEMPLATE/BUG-REPORT.yaml +++ b/.github/ISSUE_TEMPLATE/BUG-REPORT.yaml @@ -67,7 +67,12 @@ body: id: logs attributes: label: "Logs" - description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + description: | + Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + > After a crash, include the whole panic: the `Guru Meditation Error` line, the `Backtrace:` line and the `ELF file SHA256:` line. + > Each release has a `SomfyController.ino..elf.zip` that decodes the backtrace: + > `xtensa-esp32s3-elf-addr2line -pfiaC -e SomfyController.ino.esp32s3.elf ` + > (`riscv32-esp-elf-addr2line` on the C3, C5 and C6). render: bash validations: required: false \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 730b265..704dd7e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -58,6 +58,7 @@ jobs: fail-fast: false matrix: # fwname: firmware-only binary for OTA updates + # elfname: the symbols of that binary, to decode a crash's backtrace # obname: onboard image (bootloader + partitions + firmware + littlefs merged) # for flashing a new chip via USB/serial # addr_bootloader: chip-dependent (ESP32: 0x1000, S3/C3/C6: 0x0, C5: 0x2000) @@ -70,6 +71,7 @@ jobs: addr_bootloader: "0x1000" addr_fs: "0x310000" fwname: SomfyController.ino.esp32.bin + elfname: SomfyController.ino.esp32.elf fsname: SomfyController.littlefs.esp32.bin obname: SomfyController.onboard.esp32.bin - env: esp32s3 @@ -78,6 +80,7 @@ jobs: addr_bootloader: "0x0" addr_fs: "0x670000" fwname: SomfyController.ino.esp32s3.bin + elfname: SomfyController.ino.esp32s3.elf fsname: SomfyController.littlefs.esp32s3.bin obname: SomfyController.onboard.esp32s3.bin - env: esp32c3 @@ -86,6 +89,7 @@ jobs: addr_bootloader: "0x0" addr_fs: "0x310000" fwname: SomfyController.ino.esp32c3.bin + elfname: SomfyController.ino.esp32c3.elf fsname: SomfyController.littlefs.esp32c3.bin obname: SomfyController.onboard.esp32c3.bin - env: esp32c5 @@ -94,6 +98,7 @@ jobs: addr_bootloader: "0x2000" addr_fs: "0x310000" fwname: SomfyController.ino.esp32c5.bin + elfname: SomfyController.ino.esp32c5.elf fsname: SomfyController.littlefs.esp32c5.bin obname: SomfyController.onboard.esp32c5.bin - env: esp32c6 @@ -102,6 +107,7 @@ jobs: addr_bootloader: "0x0" addr_fs: "0x310000" fwname: SomfyController.ino.esp32c6.bin + elfname: SomfyController.ino.esp32c6.elf fsname: SomfyController.littlefs.esp32c6.bin obname: SomfyController.onboard.esp32c6.bin @@ -173,6 +179,16 @@ jobs: - name: Compress onboard image run: zip ${{ matrix.obname }}.zip ${{ matrix.obname }} + # A panic prints "ELF file SHA256: ". The .sha256 file + # beside the ELF holds the whole hash, so a crash log shows which build + # it came from. + - name: Compress ELF + run: | + cp .pio/build/${{ matrix.env }}/firmware.elf ${{ matrix.elfname }} + sha256sum ${{ matrix.elfname }} > ${{ matrix.elfname }}.sha256 + cat ${{ matrix.elfname }}.sha256 + zip -9 ${{ matrix.elfname }}.zip ${{ matrix.elfname }} ${{ matrix.elfname }}.sha256 + - name: Upload artifacts if: github.event_name != 'release' uses: actions/upload-artifact@v4 @@ -217,3 +233,14 @@ jobs: asset_path: ${{ matrix.obname }}.zip overwrite: true asset_content_type: application/zip + + - name: Upload ELF + if: github.event_name == 'release' + uses: shogo82148/actions-upload-release-asset@v1.7.5 + with: + github_token: ${{ github.token }} + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_name: ${{ matrix.elfname }}.zip + asset_path: ${{ matrix.elfname }}.zip + overwrite: true + asset_content_type: application/zip