From 80bad6303a08f147fc4a84b4561005087697171b Mon Sep 17 00:00:00 2001 From: umbynos Date: Fri, 10 Jul 2020 12:38:32 +0200 Subject: [PATCH 1/6] add first draft of CI --- .github/workflows/compile-examples.yml | 77 ++++++++++++++++++++++++++ 1 file changed, 77 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 000000000..c044133bd --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,77 @@ +name: Compile Examples + +on: [pull_request, push] + +jobs: + compile-test: + runs-on: ubuntu-latest + + env: + # sketch paths to compile (recursive) for all boards + UNIVERSAL_SKETCH_PATHS: '"libraries/Scheduler"' + + strategy: + fail-fast: false + + matrix: + board: [ + {"fqbn": "arduino-beta:mbed:nano33ble"}, + {"fqbn": "arduino-beta:mbed:envie_m4"}, + {"fqbn": "arduino-beta:mbed:envie_m7"} + ] + + # make board type-specific customizations to the matrix jobs + include: + # normal boards + - board: + fqbn: "arduino-beta:mbed:nano33ble" + additional-sketch-paths: '"libraries/PDM"' + - board: + fqbn: "arduino-beta:mbed:envie_m4" + additional-sketch-paths: '"libraries/doom"' + - board: + fqbn: "arduino-beta:mbed:envie_m7" + additional-sketch-paths: '"libraries/doom"' + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # The source files are in a subfolder of the ArduinoCore-API repository, so it's not possible to clone it directly to the final destination in the core + #- name: Checkout ArduinoCore-API + # uses: actions/checkout@v2 + #with: + # repository: arduino/ArduinoCore-API + # path: extras/ArduinoCore-API + + #- name: Install ArduinoCore-API + # run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino" + + #- name: Checkout Adafruit WiFiNINA + # uses: actions/checkout@v2 + # with: + # repository: adafruit/WiFiNINA + # path: adafruit/WiFiNINA + + - name: Compile examples + uses: arduino/actions/libraries/compile-examples@master + with: + fqbn: ${{ matrix.board.fqbn }} + # libraries: | + # ${{ env.UNIVERSAL_LIBRARIES }} + platforms: | + # Use Board Manager to install the latest release of Arduino mbed Boards to get the toolchain + - name: "arduino-beta:mbed" + # Overwrite the Board Manager installation with the local platform + # - source-path: "./" + # name: "arduino-beta:mbed" + sketch-paths: "${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.additional-sketch-paths }}" + # enable-size-deltas-report: 'true' + verbose: 'false' + + # - name: Save memory usage change report as artifact + # if: github.event_name == 'pull_request' + # uses: actions/upload-artifact@v1 + # with: + # name: 'size-deltas-reports' + # path: 'size-deltas-reports' \ No newline at end of file From 88a4ce68221f26c8407656f7eed0d4bc9861e477 Mon Sep 17 00:00:00 2001 From: umbynos Date: Fri, 10 Jul 2020 18:13:28 +0200 Subject: [PATCH 2/6] add libraries example to compile --- .github/workflows/compile-examples.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c044133bd..72d04df97 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -25,13 +25,13 @@ jobs: # normal boards - board: fqbn: "arduino-beta:mbed:nano33ble" - additional-sketch-paths: '"libraries/PDM"' + additional-sketch-paths: '"libraries/PDM" "libraries/ThreadDebug"' - board: fqbn: "arduino-beta:mbed:envie_m4" - additional-sketch-paths: '"libraries/doom"' + additional-sketch-paths: '"libraries/doom" "libraries/KernelDebug" "libraries/Portenta_SDCARD" "libraries/Portenta_System" "libraries/Portenta_Video" ' - board: fqbn: "arduino-beta:mbed:envie_m7" - additional-sketch-paths: '"libraries/doom"' + additional-sketch-paths: '"libraries/doom" "libraries/KernelDebug" "libraries/Portenta_Audio" "libraries/Portenta_SDCARD" "libraries/Portenta_System" "libraries/Portenta_Video" "libraries/ThreadDebug" "libraries/USBHOST"' steps: - name: Checkout repository From 4ecb59942dd162c4d088a72de4f94185bb144cd8 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 15 Jul 2020 13:11:10 +0200 Subject: [PATCH 3/6] test compile example now uses github's master core version, fixed comments --- .github/workflows/compile-examples.yml | 47 ++++++++++++-------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 72d04df97..d8835c925 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest env: - # sketch paths to compile (recursive) for all boards + # sketch paths to compile (recursive) compatible with all boards UNIVERSAL_SKETCH_PATHS: '"libraries/Scheduler"' strategy: @@ -20,9 +20,8 @@ jobs: {"fqbn": "arduino-beta:mbed:envie_m7"} ] - # make board type-specific customizations to the matrix jobs + # compile only the examples compatible with each board include: - # normal boards - board: fqbn: "arduino-beta:mbed:nano33ble" additional-sketch-paths: '"libraries/PDM" "libraries/ThreadDebug"' @@ -38,40 +37,36 @@ jobs: uses: actions/checkout@v2 # The source files are in a subfolder of the ArduinoCore-API repository, so it's not possible to clone it directly to the final destination in the core - #- name: Checkout ArduinoCore-API - # uses: actions/checkout@v2 - #with: - # repository: arduino/ArduinoCore-API - # path: extras/ArduinoCore-API + - name: Checkout ArduinoCore-API + uses: actions/checkout@v2 + with: + repository: arduino/ArduinoCore-API + ref: namespace_arduino + path: ArduinoCore-API - #- name: Install ArduinoCore-API - # run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino" + - name: Remove old symlink to api + run: rm "$GITHUB_WORKSPACE/cores/arduino/api" - #- name: Checkout Adafruit WiFiNINA - # uses: actions/checkout@v2 - # with: - # repository: adafruit/WiFiNINA - # path: adafruit/WiFiNINA + - name: Install ArduinoCore-API + run: mv "$GITHUB_WORKSPACE/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino" - name: Compile examples uses: arduino/actions/libraries/compile-examples@master with: fqbn: ${{ matrix.board.fqbn }} - # libraries: | - # ${{ env.UNIVERSAL_LIBRARIES }} platforms: | # Use Board Manager to install the latest release of Arduino mbed Boards to get the toolchain - name: "arduino-beta:mbed" # Overwrite the Board Manager installation with the local platform - # - source-path: "./" - # name: "arduino-beta:mbed" + - source-path: "./" + name: "arduino-beta:mbed" sketch-paths: "${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.additional-sketch-paths }}" - # enable-size-deltas-report: 'true' + enable-size-deltas-report: 'true' verbose: 'false' - # - name: Save memory usage change report as artifact - # if: github.event_name == 'pull_request' - # uses: actions/upload-artifact@v1 - # with: - # name: 'size-deltas-reports' - # path: 'size-deltas-reports' \ No newline at end of file + - name: Save memory usage change report as artifact + if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v1 + with: + name: 'size-deltas-reports' + path: 'size-deltas-reports' \ No newline at end of file From a31e09d7e15f70afdb9fd476ff2d291d2fd81787 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 15 Jul 2020 15:33:19 +0200 Subject: [PATCH 4/6] fix report deltas --- .github/workflows/compile-examples.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index d8835c925..c10269180 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -61,12 +61,4 @@ jobs: - source-path: "./" name: "arduino-beta:mbed" sketch-paths: "${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.additional-sketch-paths }}" - enable-size-deltas-report: 'true' - verbose: 'false' - - - name: Save memory usage change report as artifact - if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v1 - with: - name: 'size-deltas-reports' - path: 'size-deltas-reports' \ No newline at end of file + verbose: 'false' \ No newline at end of file From 1fbfb4a9f8d6ddae53517fa7ffaacc9c06b8b520 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 15 Jul 2020 17:15:40 +0200 Subject: [PATCH 5/6] apply suggestion from @per1234 --- .github/workflows/compile-examples.yml | 37 ++++++++++++++++++-------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c10269180..40f6faba1 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -1,9 +1,25 @@ name: Compile Examples -on: [pull_request, push] +on: + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "cores/**" + - "libraries/**" + - "variants/**" + - "boards.txt" + - "platform.txt" + push: + paths: + - ".github/workflows/compile-examples.yml" + - "cores/**" + - "libraries/**" + - "variants/**" + - "boards.txt" + - "platform.txt" jobs: - compile-test: + compile-examples: runs-on: ubuntu-latest env: @@ -14,22 +30,21 @@ jobs: fail-fast: false matrix: - board: [ - {"fqbn": "arduino-beta:mbed:nano33ble"}, - {"fqbn": "arduino-beta:mbed:envie_m4"}, - {"fqbn": "arduino-beta:mbed:envie_m7"} - ] + board: + - fqbn: arduino-beta:mbed:nano33ble + - fqbn: arduino-beta:mbed:envie_m4 + - fqbn: arduino-beta:mbed:envie_m7 # compile only the examples compatible with each board include: - board: - fqbn: "arduino-beta:mbed:nano33ble" + fqbn: arduino-beta:mbed:nano33ble additional-sketch-paths: '"libraries/PDM" "libraries/ThreadDebug"' - board: - fqbn: "arduino-beta:mbed:envie_m4" + fqbn: arduino-beta:mbed:envie_m4 additional-sketch-paths: '"libraries/doom" "libraries/KernelDebug" "libraries/Portenta_SDCARD" "libraries/Portenta_System" "libraries/Portenta_Video" ' - board: - fqbn: "arduino-beta:mbed:envie_m7" + fqbn: arduino-beta:mbed:envie_m7 additional-sketch-paths: '"libraries/doom" "libraries/KernelDebug" "libraries/Portenta_Audio" "libraries/Portenta_SDCARD" "libraries/Portenta_System" "libraries/Portenta_Video" "libraries/ThreadDebug" "libraries/USBHOST"' steps: @@ -61,4 +76,4 @@ jobs: - source-path: "./" name: "arduino-beta:mbed" sketch-paths: "${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.additional-sketch-paths }}" - verbose: 'false' \ No newline at end of file + verbose: 'false' From 8ecb8f5a1ba46bf7398dda02b904e26324c08805 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 20 Jul 2020 10:50:53 +0200 Subject: [PATCH 6/6] add report deltas for compiled sketches --- .github/workflows/compile-examples.yml | 8 ++++++++ .github/workflows/report-size-deltas.yml | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 40f6faba1..99ec66daf 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -77,3 +77,11 @@ jobs: name: "arduino-beta:mbed" sketch-paths: "${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.additional-sketch-paths }}" verbose: 'false' + enable-size-deltas-report: true + + - name: Save memory usage change report as artifact + if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v1 + with: + name: size-deltas-reports + path: size-deltas-reports diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 000000000..880ce7ba8 --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,11 @@ +on: + schedule: + - cron: '*/5 * * * *' + +jobs: + report: + runs-on: ubuntu-latest + + steps: + - name: Comment size deltas reports to PRs + uses: arduino/actions/libraries/report-size-deltas@master \ No newline at end of file