Skip to content

Commit

Permalink
Print build dependencies on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Oct 10, 2024
1 parent 6e49411 commit b12572a
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 47 deletions.
98 changes: 51 additions & 47 deletions .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
build-esp32sx-esptool:
name: Build ESP32-Sx
name: 🏗️ESP32-Sx
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -22,7 +22,7 @@ jobs:
include:
- offset: "0x1000"
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -33,9 +33,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Checkout Board Definitions
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -72,8 +72,8 @@ jobs:
- name: Install Dependencies (esptool)
run: |
pip3 install esptool
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: Build for ESP32-SX (esptool)
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: list files
run: |
ls -Rla examples/
Expand All @@ -100,7 +100,7 @@ jobs:
} >> "$GITHUB_OUTPUT"
- name: Check boot_app0 file existence (esp32sx built from core, not-source)
id: check_files
uses: andstor/file-existence-action@v2
uses: andstor/file-existence-action@v3
with:
files: "/home/runner/.arduino15/packages/esp32/hardware/esp32/*/tools/partitions/boot_app0.bin"
- name: list arduino esp32 core files
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
build-esp32sx:
name: Build ESP32-Sx
name: 🏗️ESP32-Sx
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -171,7 +171,7 @@ jobs:
"qtpy_esp32s3_n4r2",
]
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -182,9 +182,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
Expand Down Expand Up @@ -214,11 +214,11 @@ jobs:
run: |
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: list
run: |
ls
ls examples/*/build/
python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: list files (tree)
run: |
tree
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand All @@ -232,7 +232,7 @@ jobs:
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
build-esp32:
name: Build ESP32 and Cx
name: 🏗️ESP32, ESP32-C3
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -253,7 +253,7 @@ jobs:
- offset: "0x0"
arduino-platform: "wippersnapper_feather_esp32c6"
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -264,9 +264,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Checkout Board Definitions
uses: actions/checkout@v4
with:
Expand All @@ -290,7 +290,7 @@ jobs:
run: |
pip3 install esptool
- name: build ESP32 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: Check artifacts
run: |
ls examples/Wippersnapper_demo/build/*
Expand All @@ -303,7 +303,7 @@ jobs:
mv examples/Wippersnapper_demo/build/*/Wippersnapper_demo.ino.partitions.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.partitions.bin
- name: Check boot_app0 file existence (esp32 built from core, not-source)
id: check_files
uses: andstor/file-existence-action@v2
uses: andstor/file-existence-action@v3
with:
files: "/home/runner/.arduino15/packages/esp32/hardware/esp32/*/tools/partitions/boot_app0.bin"
- name: boot_app0 file from arduino-cli core
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:
wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.zip
build-samd:
name: Build WipperSnapper SAMD
name: 🏗️SAMD
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -362,7 +362,7 @@ jobs:
"metro_m4_airliftlite_tinyusb",
]
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -373,7 +373,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -392,8 +393,8 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build SAMD platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand All @@ -407,14 +408,14 @@ jobs:
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.hex
build-rp2040:
name: Build WipperSnapper RP2040
name: 🏗️RP2040
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arduino-platform: ["picow_rp2040_tinyusb"]
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -425,7 +426,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -443,8 +445,8 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build RP2040 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand All @@ -457,14 +459,14 @@ jobs:
# NOTE: This does NOT release artifacts, it only builds
build-samd-non-fs:
name: Build WipperSnapper SAMD (NO-TINYUSB)
name: 🏗️SAMD (NO-TINYUSB)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arduino-platform: ["mkrwifi1010", "nano_33_iot"]
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -475,7 +477,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -493,18 +496,18 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build SAMD (no-FS) platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h

build-esp8266:
name: Build WipperSnapper ESP8266
name: 🏗️ESP8266
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arduino-platform: ["feather_esp8266"]
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -515,7 +518,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -531,8 +535,8 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build ESP8266 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: list build artifacts
run: |
ls
Expand All @@ -553,7 +557,7 @@ jobs:
wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.zip
build-esp32sx-dev:
name: Build WipperSnapper ESP32-Sx DEV BUILDS
name: 🏗️ESP32-Sx DEV BUILDS
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -567,7 +571,7 @@ jobs:
"feather_esp32s3_tft_debug",
]
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand All @@ -578,9 +582,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
Expand Down Expand Up @@ -610,7 +614,7 @@ jobs:
run: |
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: list
run: |
ls
Expand Down Expand Up @@ -753,7 +757,7 @@ jobs:
build-rp2040,
]
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
Expand Down
9 changes: 9 additions & 0 deletions src/print_dependencies.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "print_dependencies.h"

const char *project_dependencies = R"(
Libraries and Versions:
** This is a placeholder, you can fill this in automatically by running arduino-cli and copying the output here. **
Platforms and Versions:
** Board Support Package placeholder **
)";
6 changes: 6 additions & 0 deletions src/print_dependencies.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef PROJECT_DEPENDENCIES_H
#define PROJECT_DEPENDENCIES_H

#define PRINT_DEPENDENCIES 0
extern const char *project_dependencies;
#endif // PROJECT_DEPENDENCIES_H
8 changes: 8 additions & 0 deletions src/provisioning/littlefs/WipperSnapper_LittleFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
*/
/**************************************************************************/
WipperSnapper_LittleFS::WipperSnapper_LittleFS() {
#if PRINT_DEPENDENCIES
// Print project build dependencies
WS_DEBUG_PRINTLN("Build Dependencies:");
WS_DEBUG_PRINTLN("*********************");
WS_DEBUG_PRINTLN(project_dependencies);
WS_DEBUG_PRINTLN("*********************");
#endif

// Attempt to initialize filesystem
if (!LittleFS.begin()) {
setStatusLEDColor(RED);
Expand Down
Loading

0 comments on commit b12572a

Please sign in to comment.