From 9c0e280fabd21d980f75b10a5f919abfec589b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Cie=C5=9Blik?= Date: Thu, 21 May 2026 23:20:55 +0200 Subject: [PATCH] Add firmware artifacts, memory summary, and Doxygen gh-pages deploy CMakeLists.txt: generate firmware.map via -Wl,-Map. CI build job: - Writes per-section size table to the Gitea job summary (visible in the Actions UI after each run). - Uploads firmware.hex and firmware.map as a downloadable artifact named firmware-. CI docs job: - On push to main, force-pushes docs/html/ as an orphan commit to the gh-pages branch. Gitea Pages must be enabled in site admin for the HTML to be served; the branch is always available via the repo file browser regardless. --- .gitea/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++-- CMakeLists.txt | 1 + 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c522e45..eb70545 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -25,8 +25,26 @@ jobs: - name: Compile firmware run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel . && ninja -C build - - name: Print size - run: arm-none-eabi-size build/firmware + - name: Memory summary + run: | + echo '## Memory usage' >> "$GITHUB_STEP_SUMMARY" + echo '' >> "$GITHUB_STEP_SUMMARY" + echo '```' >> "$GITHUB_STEP_SUMMARY" + arm-none-eabi-size -A build/firmware \ + | grep -E '^\.(text|data|bss|rodata|ARM)' \ + >> "$GITHUB_STEP_SUMMARY" + echo '' >> "$GITHUB_STEP_SUMMARY" + arm-none-eabi-size build/firmware | tail -1 >> "$GITHUB_STEP_SUMMARY" + echo '```' >> "$GITHUB_STEP_SUMMARY" + + - name: Upload firmware artifacts + uses: actions/upload-artifact@v4 + with: + name: firmware-${{ github.sha }} + path: | + build/firmware.hex + build/firmware.map + if-no-files-found: error format: name: Check formatting @@ -80,3 +98,19 @@ jobs: run: | doxygen Doxyfile 2>&1 | tee /tmp/doxy.log ! grep -q 'warning:' /tmp/doxy.log + + - name: Deploy to gh-pages + if: github.ref == 'refs/heads/main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd docs/html + git init -b gh-pages + git config user.name "ci" + git config user.email "ci@localhost" + git add -A + git commit -m "docs: ${GITHUB_SHA}" + SERVER="${GITHUB_SERVER_URL#https://}" + git push --force \ + "https://x-token:${GITHUB_TOKEN}@${SERVER}/${GITHUB_REPOSITORY}.git" \ + HEAD:gh-pages diff --git a/CMakeLists.txt b/CMakeLists.txt index ac0ef2b..12073a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ target_link_options(firmware PRIVATE -T ${CMAKE_SOURCE_DIR}/link/nrf52840.ld -Wl,--gc-sections -Wl,--print-memory-usage + -Wl,-Map=${CMAKE_BINARY_DIR}/firmware.map -nostartfiles -specs=nano.specs -specs=nosys.specs