From 34b6137e5c7160da063fb22b2a1b336f5b7e48b8 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Tue, 7 Jul 2026 23:22:59 +0200 Subject: [PATCH 1/4] Generate device matrix --- .github/workflows/build.yml | 61 +++++------------------ Buildscripts/gh-generate-device-matrix.py | 57 +++++++++++++++++++++ 2 files changed, 69 insertions(+), 49 deletions(-) create mode 100644 Buildscripts/gh-generate-device-matrix.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3390cb8d7..a62cf5304 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,57 +30,20 @@ jobs: with: board_id: ${{ matrix.board.id }} arch: ${{ matrix.board.arch }} - BuildFirmware: - strategy: - matrix: - board: [ - { id: btt-panda-touch, arch: esp32s3 }, - { id: cyd-2432s024c, arch: esp32 }, - { id: cyd-2432s024r, arch: esp32 }, - { id: cyd-2432s028r, arch: esp32 }, - { id: cyd-2432s028rv3, arch: esp32 }, - { id: cyd-e32r28t, arch: esp32 }, - { id: cyd-e32r32p, arch: esp32 }, - { id: cyd-2432s032c, arch: esp32 }, - { id: cyd-3248s035c, arch: esp32 }, - { id: cyd-8048s043c, arch: esp32s3 }, - { id: cyd-4848s040c, arch: esp32s3 }, - { id: elecrow-crowpanel-advance-28, arch: esp32s3 }, - { id: elecrow-crowpanel-advance-35, arch: esp32s3 }, - { id: elecrow-crowpanel-advance-50, arch: esp32s3 }, - { id: elecrow-crowpanel-basic-28, arch: esp32 }, - { id: elecrow-crowpanel-basic-35, arch: esp32 }, - { id: elecrow-crowpanel-basic-50, arch: esp32s3 }, - { id: guition-jc1060p470ciwy, arch: esp32p4 }, - { id: guition-jc2432w328c, arch: esp32 }, - { id: guition-jc3248w535c, arch: esp32s3 }, - { id: guition-jc8048w550c, arch: esp32s3 }, - { id: heltec-wifi-lora-32-v3, arch: esp32s3 }, - { id: lilygo-tdeck, arch: esp32s3 }, - { id: lilygo-thmi, arch: esp32s3 }, - { id: lilygo-tdongle-s3, arch: esp32s3 }, - { id: lilygo-tdisplay-s3, arch: esp32s3 }, - { id: lilygo-tlora-pager, arch: esp32s3 }, - { id: lilygo-tdisplay, arch: esp32 }, - { id: m5stack-cardputer, arch: esp32s3 }, - { id: m5stack-cardputer-adv, arch: esp32s3 }, - { id: m5stack-core2, arch: esp32 }, - { id: m5stack-cores3, arch: esp32s3 }, - { id: m5stack-papers3, arch: esp32s3 }, - { id: m5stack-stackchan, arch: esp32s3 }, - { id: m5stack-stickc-plus2, arch: esp32 }, - { id: m5stack-sticks3, arch: esp32s3 }, - { id: m5stack-tab5, arch: esp32p4 }, - { id: unphone, arch: esp32s3 }, - { id: waveshare-esp32-s3-geek, arch: esp32s3 }, - { id: waveshare-s3-lcd-13, arch: esp32s3 }, - { id: waveshare-s3-touch-lcd-128, arch: esp32s3 }, - { id: waveshare-s3-touch-lcd-147, arch: esp32s3 }, - { id: waveshare-s3-touch-lcd-43, arch: esp32s3 }, - { id: wireless-tag-wt32-sc01-plus, arch: esp32s3 } - ] + GenerateDeviceMatrix: runs-on: ubuntu-latest needs: [ BuildSdk ] + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + - id: set-matrix + run: python3 Buildscripts/gh-generate-device-matrix.py + BuildFirmware: + runs-on: ubuntu-latest + needs: GenerateDeviceMatrix + strategy: + matrix: ${{ fromJSON(needs.generate-device-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v4 with: diff --git a/Buildscripts/gh-generate-device-matrix.py b/Buildscripts/gh-generate-device-matrix.py new file mode 100644 index 000000000..7f240bf16 --- /dev/null +++ b/Buildscripts/gh-generate-device-matrix.py @@ -0,0 +1,57 @@ +import fnmatch +import json +import os +import sys + +DEVICES_DIRECTORY = os.path.join(os.path.dirname(__file__), "..", "Devices") + +IGNORE_LIST = { + "simulator", + "generic-*", +} + + +def is_ignored(device_id): + return any(fnmatch.fnmatch(device_id, pattern) for pattern in IGNORE_LIST) + +def read_properties_file(path): + properties = {} + with open(path, "r") as file: + for line in file: + stripped = line.strip() + if not stripped or stripped.startswith("#"): + continue + key, sep, value = line.partition("=") + if not sep: + continue + properties[key.strip()] = value.strip() + return properties + +def get_board_entries(): + boards = [] + for device_id in sorted(os.listdir(DEVICES_DIRECTORY)): + if is_ignored(device_id): + continue + device_dir = os.path.join(DEVICES_DIRECTORY, device_id) + properties_path = os.path.join(device_dir, "device.properties") + if not os.path.isdir(device_dir) or not os.path.isfile(properties_path): + continue + properties = read_properties_file(properties_path) + target = properties.get("hardware.target") + if not target: + sys.exit(f"ERROR: {properties_path} has no hardware.target property") + boards.append({"id": device_id, "arch": target.lower()}) + return boards + +def main(): + matrix_json = json.dumps({"board": get_board_entries()}) + + github_output = os.environ.get("GITHUB_OUTPUT") + if github_output: + with open(github_output, "a") as file: + file.write(f"matrix={matrix_json}\n") + else: + print(matrix_json) + +if __name__ == "__main__": + main() From 021dcf1f50d05e32372055c1591f262ca0f3d6e2 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Tue, 7 Jul 2026 23:23:56 +0200 Subject: [PATCH 2/4] Add device_find_first_by_type to kernel symbol list --- TactilityKernel/source/kernel_symbols.c | 1 + 1 file changed, 1 insertion(+) diff --git a/TactilityKernel/source/kernel_symbols.c b/TactilityKernel/source/kernel_symbols.c index 49e688443..4e2b2e8e4 100644 --- a/TactilityKernel/source/kernel_symbols.c +++ b/TactilityKernel/source/kernel_symbols.c @@ -63,6 +63,7 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = { DEFINE_MODULE_SYMBOL(device_exists_of_type), DEFINE_MODULE_SYMBOL(device_find_by_name), DEFINE_MODULE_SYMBOL(device_find_first_active_by_type), + DEFINE_MODULE_SYMBOL(device_find_first_by_type), // driver DEFINE_MODULE_SYMBOL(driver_construct), DEFINE_MODULE_SYMBOL(driver_destruct), From 9f110efdad0316196f45b99f97bfcdce894e07ac Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Tue, 7 Jul 2026 23:35:02 +0200 Subject: [PATCH 3/4] Fix for job --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a62cf5304..de5010091 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest needs: GenerateDeviceMatrix strategy: - matrix: ${{ fromJSON(needs.generate-device-matrix.outputs.matrix) }} + matrix: ${{ fromJSON(needs.GenerateDeviceMatrix.outputs.matrix) }} steps: - uses: actions/checkout@v4 with: From e6e04954aaeacc65d9cda8d88148f7b0c28bae5d Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Tue, 7 Jul 2026 23:36:01 +0200 Subject: [PATCH 4/4] Security improvement --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de5010091..c7cdb6153 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,8 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - id: set-matrix run: python3 Buildscripts/gh-generate-device-matrix.py BuildFirmware: