diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 000000000..99ec66daf --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,87 @@ +name: Compile Examples + +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-examples: + runs-on: ubuntu-latest + + env: + # sketch paths to compile (recursive) compatible with 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 + + # compile only the examples compatible with each board + include: + - board: + fqbn: arduino-beta:mbed:nano33ble + additional-sketch-paths: '"libraries/PDM" "libraries/ThreadDebug"' + - board: + 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 + 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 + 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 + ref: namespace_arduino + path: ArduinoCore-API + + - name: Remove old symlink to api + run: rm "$GITHUB_WORKSPACE/cores/arduino/api" + + - 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 }} + 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 }}" + 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