From f930d2b785bef2c8689a345fce9464c093e1d368 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 27 May 2025 12:50:25 +0200 Subject: [PATCH 1/7] Added sketch compile workflow --- .github/workflows/compile-examples.yml | 150 +++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 .github/workflows/compile-examples.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..d64e824 --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,150 @@ +name: Compile Examples + +on: + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "library.properties" + - "examples/**" + - "src/**" + push: + paths: + - ".github/workflows/compile-examples.yml" + - "library.properties" + - "examples/**" + - "src/**" + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + build: + name: ${{ matrix.board.fqbn }} + runs-on: ubuntu-latest + + env: + LIBRARIES: | + # Install the NetworkConfigurator library from the repository + - source-path: ./ + - name: ArxContainer + - name: ArxTypeTraits + - name: DebugLog + SKETCH_PATHS: | + - examples/rpc_lite_client + - examples/rpc_lite_dummy + - examples/rpc_lite_server + SKETCHES_REPORTS_PATH: sketches-reports + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:samd:mkrwifi1010 + type: nina + artifact-name-suffix: arduino-samd-mkrwifi1010 + - fqbn: arduino:samd:nano_33_iot + type: nina + artifact-name-suffix: arduino-samd-nano_33_iot + - fqbn: arduino:mbed_portenta:envie_m7 + type: mbed_portenta + artifact-name-suffix: arduino-mbed_portenta-envie_m7 + - fqbn: arduino:mbed_nano:nanorp2040connect + type: nina + artifact-name-suffix: arduino-mbed_nano-nanorp2040connect + - fqbn: arduino:mbed_nicla:nicla_vision + type: mbed_nicla + artifact-name-suffix: arduino-mbed_nicla-nicla_vision + - fqbn: arduino:mbed_opta:opta + type: mbed_opta + artifact-name-suffix: arduino-mbed_opta-opta + - fqbn: arduino:mbed_giga:giga + type: mbed_giga + artifact-name-suffix: arduino-mbed_giga-giga + - fqbn: arduino:renesas_portenta:portenta_c33 + type: renesas_portenta + artifact-name-suffix: arduino-renesas_portenta-portenta_c33 + - fqbn: arduino:renesas_uno:unor4wifi + type: renesas_uno + artifact-name-suffix: arduino-renesas_uno-unor4wifi + + + # make board type-specific customizations to the matrix jobs + include: + # MKR WiFi 1010, Nano 33 IoT, Nano RP2040 Connect + - board: + type: nina + platforms: | + # Install samd and mbed_nano platform via Boards Manager + - name: arduino:samd + - name: arduino:mbed_nano + libraries: {} + # Portenta + - board: + type: mbed_portenta + platforms: | + # Install mbed_portenta platform via Boards Manager + - name: arduino:mbed_portenta + libraries: {} + # Nicla Vision + - board: + type: mbed_nicla + platforms: | + # Install mbed_nicla platform via Boards Manager + - name: arduino:mbed_nicla + libraries: {} + # Opta + - board: + type: mbed_opta + platforms: | + # Install mbed_opta platform via Boards Manager + - name: arduino:mbed_opta + libraries: {} + # GIGA + - board: + type: mbed_giga + platforms: | + # Install mbed_giga platform via Boards Manager + - name: arduino:mbed_giga + libraries: {} + # Portenta C33 + - board: + type: renesas_portenta + platforms: | + # Install renesas_portenta platform via Boards Manager + - name: arduino:renesas_portenta + libraries: {} + # UNO R4 WiFi + - board: + type: renesas_uno + platforms: | + # Install renesas_uno platform via Boards Manager + - name: arduino:renesas_uno + libraries: {} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + platforms: ${{ matrix.platforms }} + fqbn: ${{ matrix.board.fqbn }} + libraries: | + ${{ env.LIBRARIES }} + ${{ matrix.libraries }} + sketch-paths: | + ${{ env.SKETCH_PATHS }} + enable-deltas-report: 'true' + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Save memory usage change report as artifact + if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: sketches-report-${{ matrix.board.artifact-name-suffix }} + path: ${{ env.SKETCHES_REPORTS_PATH }} From 2fedd067a22c58975a3676d6d16e228106344caa Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 27 May 2025 13:01:15 +0200 Subject: [PATCH 2/7] Temporarily disable delta reports --- .github/workflows/compile-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index d64e824..937fe3c 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -138,7 +138,7 @@ jobs: ${{ matrix.libraries }} sketch-paths: | ${{ env.SKETCH_PATHS }} - enable-deltas-report: 'true' + #enable-deltas-report: 'true' sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Save memory usage change report as artifact From 98bf0a90f62c3ed22d046706627ae1f10514a04f Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 27 May 2025 13:15:05 +0200 Subject: [PATCH 3/7] Simplify job --- .github/workflows/compile-examples.yml | 66 +++----------------------- 1 file changed, 7 insertions(+), 59 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 937fe3c..c822f71 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -32,9 +32,14 @@ jobs: - name: ArxTypeTraits - name: DebugLog SKETCH_PATHS: | + - examples/decoder_example + - examples/dispatcher_example - examples/rpc_lite_client - examples/rpc_lite_dummy - examples/rpc_lite_server + - examples/simple_client + - examples/unpacker_test + - examples/wrapper_example SKETCHES_REPORTS_PATH: sketches-reports strategy: fail-fast: false @@ -69,60 +74,6 @@ jobs: type: renesas_uno artifact-name-suffix: arduino-renesas_uno-unor4wifi - - # make board type-specific customizations to the matrix jobs - include: - # MKR WiFi 1010, Nano 33 IoT, Nano RP2040 Connect - - board: - type: nina - platforms: | - # Install samd and mbed_nano platform via Boards Manager - - name: arduino:samd - - name: arduino:mbed_nano - libraries: {} - # Portenta - - board: - type: mbed_portenta - platforms: | - # Install mbed_portenta platform via Boards Manager - - name: arduino:mbed_portenta - libraries: {} - # Nicla Vision - - board: - type: mbed_nicla - platforms: | - # Install mbed_nicla platform via Boards Manager - - name: arduino:mbed_nicla - libraries: {} - # Opta - - board: - type: mbed_opta - platforms: | - # Install mbed_opta platform via Boards Manager - - name: arduino:mbed_opta - libraries: {} - # GIGA - - board: - type: mbed_giga - platforms: | - # Install mbed_giga platform via Boards Manager - - name: arduino:mbed_giga - libraries: {} - # Portenta C33 - - board: - type: renesas_portenta - platforms: | - # Install renesas_portenta platform via Boards Manager - - name: arduino:renesas_portenta - libraries: {} - # UNO R4 WiFi - - board: - type: renesas_uno - platforms: | - # Install renesas_uno platform via Boards Manager - - name: arduino:renesas_uno - libraries: {} - steps: - name: Checkout uses: actions/checkout@v4 @@ -133,11 +84,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} platforms: ${{ matrix.platforms }} fqbn: ${{ matrix.board.fqbn }} - libraries: | - ${{ env.LIBRARIES }} - ${{ matrix.libraries }} - sketch-paths: | - ${{ env.SKETCH_PATHS }} + libraries: ${{ env.LIBRARIES }} + sketch-paths: ${{ env.SKETCH_PATHS }} #enable-deltas-report: 'true' sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} From 833e5a1cb17fd62d873457219209f7bd9b61f413 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 28 May 2025 10:45:40 +0200 Subject: [PATCH 4/7] Update .github/workflows/compile-examples.yml Co-authored-by: Per Tillisch --- .github/workflows/compile-examples.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c822f71..abe3d44 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -23,6 +23,7 @@ jobs: build: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest + permissions: {} env: LIBRARIES: | From 0176a4d48204a1c7e25cb5ca0d0412a7f64348c9 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 28 May 2025 10:51:06 +0200 Subject: [PATCH 5/7] Removed useless 'type' tags in the matrix configuration --- .github/workflows/compile-examples.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index abe3d44..0a80374 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -48,31 +48,22 @@ jobs: matrix: board: - fqbn: arduino:samd:mkrwifi1010 - type: nina artifact-name-suffix: arduino-samd-mkrwifi1010 - fqbn: arduino:samd:nano_33_iot - type: nina artifact-name-suffix: arduino-samd-nano_33_iot - fqbn: arduino:mbed_portenta:envie_m7 - type: mbed_portenta artifact-name-suffix: arduino-mbed_portenta-envie_m7 - fqbn: arduino:mbed_nano:nanorp2040connect - type: nina artifact-name-suffix: arduino-mbed_nano-nanorp2040connect - fqbn: arduino:mbed_nicla:nicla_vision - type: mbed_nicla artifact-name-suffix: arduino-mbed_nicla-nicla_vision - fqbn: arduino:mbed_opta:opta - type: mbed_opta artifact-name-suffix: arduino-mbed_opta-opta - fqbn: arduino:mbed_giga:giga - type: mbed_giga artifact-name-suffix: arduino-mbed_giga-giga - fqbn: arduino:renesas_portenta:portenta_c33 - type: renesas_portenta artifact-name-suffix: arduino-renesas_portenta-portenta_c33 - fqbn: arduino:renesas_uno:unor4wifi - type: renesas_uno artifact-name-suffix: arduino-renesas_uno-unor4wifi steps: From d72294550844e9850d118fc8ad03b94a2705a145 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 28 May 2025 10:54:11 +0200 Subject: [PATCH 6/7] Added read permissions --- .github/workflows/compile-examples.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 0a80374..ae5f57a 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -23,7 +23,9 @@ jobs: build: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest - permissions: {} + permissions: { + contents: read + } env: LIBRARIES: | From 321e8f71c77e4796c72969ecabbb7edf52a1da8d Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 28 May 2025 10:55:59 +0200 Subject: [PATCH 7/7] Removed example --- .github/workflows/compile-examples.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index ae5f57a..c6f8f8e 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -38,7 +38,6 @@ jobs: - examples/decoder_example - examples/dispatcher_example - examples/rpc_lite_client - - examples/rpc_lite_dummy - examples/rpc_lite_server - examples/simple_client - examples/unpacker_test