From 7d317f0919d2d7d44d10f97b87dcd0690a4f7f3d Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Tue, 7 Mar 2023 14:55:12 +0100 Subject: [PATCH 1/4] CI: Add smoke-test style compilation of all examples. --- .github/workflows/compile-examples.yml | 78 ++++++++++++++++++++++++ .github/workflows/report-size-deltas.yml | 24 ++++++++ README.md | 1 + 3 files changed, 103 insertions(+) create mode 100644 .github/workflows/compile-examples.yml create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..5c0d9bd --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,78 @@ +name: Compile Examples + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/compile-examples.yml" + - "examples/**" + - "src/**" + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "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: + SKETCHES_REPORTS_PATH: sketches-reports + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:mbed_portenta:envie_m7 + platforms: | + - name: arduino:mbed_portenta + - fqbn: arduino:mbed_portenta:envie_m4 + platforms: | + - name: arduino:mbed_portenta + - fqbn: arduino:mbed_nano:nano33ble + platforms: | + - name: arduino:mbed_nano + - fqbn: arduino:mbed_nano:nanorp2040connect + platforms: | + - name: arduino:mbed_nano + - fqbn: arduino:mbed_edge:edge_control + platforms: | + - name: arduino:mbed_edge + - fqbn: arduino:mbed_giga:giga + platforms: | + - name: arduino:mbed_giga + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fqbn: ${{ matrix.board.fqbn }} + platforms: ${{ matrix.board.platforms }} + libraries: | + # Install the library from the local path. + - source-path: ./ + - name: Arduino_Portenta_OTA + - name: Arduino_DebugUtils + sketch-paths: | + - examples + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Save sketches report as workflow artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + path: ${{ env.SKETCHES_REPORTS_PATH }} + name: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..652be5d --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports diff --git a/README.md b/README.md index 4720005..e46f5b8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ `USBHostMbed5` ============== +[![Compile Examples status](https://github.com/facchinm/USBHostMbed5/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/facchinm/USBHostMbed5/actions/workflows/compile-examples.yml) [![Spell Check status](https://github.com/facchinm/USBHostMbed5/actions/workflows/spell-check.yml/badge.svg)](https://github.com/facchinm/USBHostMbed5/actions/workflows/spell-check.yml) [![Sync Labels status](https://github.com/facchinm/USBHostMbed5/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/facchinm/USBHostMbed5/actions/workflows/sync-labels.yml) [![Arduino Lint](https://github.com/facchinm/USBHostMbed5/workflows/Arduino%20Lint/badge.svg)](https://github.com/facchinm/USBHostMbed5/actions?workflow=Arduino+Lint) From d2b58b6ec0b1139c16086b50661335fccea67528 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Tue, 7 Mar 2023 15:11:03 +0100 Subject: [PATCH 2/4] Limit to architectures based on STM32H747. --- .github/workflows/compile-examples.yml | 9 --------- library.properties | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 5c0d9bd..c0b4f2a 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -37,15 +37,6 @@ jobs: - fqbn: arduino:mbed_portenta:envie_m4 platforms: | - name: arduino:mbed_portenta - - fqbn: arduino:mbed_nano:nano33ble - platforms: | - - name: arduino:mbed_nano - - fqbn: arduino:mbed_nano:nanorp2040connect - platforms: | - - name: arduino:mbed_nano - - fqbn: arduino:mbed_edge:edge_control - platforms: | - - name: arduino:mbed_edge - fqbn: arduino:mbed_giga:giga platforms: | - name: arduino:mbed_giga diff --git a/library.properties b/library.properties index 993dece..1a2bc8c 100644 --- a/library.properties +++ b/library.properties @@ -6,4 +6,4 @@ sentence=Porting mbed5 usbhost library paragraph=Porting mbed5 usbhost library category=Communication url=https://github.com/facchinm/USBHostMbed5 -architectures=mbed,mbed_portenta +architectures=mbed,mbed_portenta,mbed_giga From 641001d5d18172a2b1da51fd034dc0d835342a95 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Tue, 7 Mar 2023 15:11:58 +0100 Subject: [PATCH 3/4] Fix: FQPN for Portenta H7/M4 is now selected via parameter. --- .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 c0b4f2a..9494d41 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -34,7 +34,7 @@ jobs: - fqbn: arduino:mbed_portenta:envie_m7 platforms: | - name: arduino:mbed_portenta - - fqbn: arduino:mbed_portenta:envie_m4 + - fqbn: arduino:mbed_portenta:envie_m7:target_core=cm4 platforms: | - name: arduino:mbed_portenta - fqbn: arduino:mbed_giga:giga From c0da6a7323cc8dbaa41ea63a3828c6b6f7b759de Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Tue, 7 Mar 2023 15:26:47 +0100 Subject: [PATCH 4/4] Does not work for M4 core. --- .github/workflows/compile-examples.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 9494d41..1dff4f6 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -34,9 +34,6 @@ jobs: - fqbn: arduino:mbed_portenta:envie_m7 platforms: | - name: arduino:mbed_portenta - - fqbn: arduino:mbed_portenta:envie_m7:target_core=cm4 - platforms: | - - name: arduino:mbed_portenta - fqbn: arduino:mbed_giga:giga platforms: | - name: arduino:mbed_giga