|
| 1 | +name: Compile Examples |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - ".github/workflows/compile-examples.yml" |
| 7 | + - "examples/**" |
| 8 | + - "src/**" |
| 9 | + push: |
| 10 | + paths: |
| 11 | + - ".github/workflows/compile-examples.yml" |
| 12 | + - "examples/**" |
| 13 | + - "src/**" |
| 14 | + |
| 15 | +jobs: |
| 16 | + compile-test: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + env: |
| 20 | + # libraries to install for all boards |
| 21 | + UNIVERSAL_LIBRARIES: | |
| 22 | + # Install the ArduinoThreads library from the repository |
| 23 | + - source-path: ./ |
| 24 | + - name: Arduino_LSM9DS1 |
| 25 | + - name: Arduino_APDS9960 |
| 26 | + - name: ArduinoECCX08 |
| 27 | + - name: Arduino_HTS221 |
| 28 | + - name: OneWire |
| 29 | + # sketch paths to compile (recursive) for all boards |
| 30 | + UNIVERSAL_SKETCH_PATHS: | |
| 31 | + - examples |
| 32 | + ARDUINOCORE_MBED_STAGING_PATH: extras/ArduinoCore-mbed |
| 33 | + ARDUINOCORE_API_STAGING_PATH: extras/ArduinoCore-API |
| 34 | + |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + |
| 38 | + matrix: |
| 39 | + fqbn: |
| 40 | + - "arduino:mbed:nano33ble" |
| 41 | + # - "arduino:mbed:envie_m4" |
| 42 | + - "arduino:mbed:envie_m7" |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v2 |
| 47 | + |
| 48 | + # it's necessary to checkout the platform before installing it so that the ArduinoCore-API dependency can be added |
| 49 | + - name: Checkout ArduinoCore-mbed |
| 50 | + # this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used |
| 51 | + uses: actions/checkout@v2 |
| 52 | + with: |
| 53 | + repository: arduino/ArduinoCore-mbed |
| 54 | + # the arduino/actions/libraries/compile-examples action will install the platform from this path |
| 55 | + path: ${{ env.ARDUINOCORE_MBED_STAGING_PATH }} |
| 56 | + |
| 57 | + - name: Remove ArduinoCore-API symlink from Arduino mbed-Enabled Boards platform |
| 58 | + # this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used |
| 59 | + run: rm "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino/api" |
| 60 | + |
| 61 | + - name: Checkout ArduinoCore-API |
| 62 | + # this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used |
| 63 | + uses: actions/checkout@v2 |
| 64 | + with: |
| 65 | + repository: arduino/ArduinoCore-API |
| 66 | + # as specified at https://github.com/arduino/ArduinoCore-mbed/blob/master/README.md#installation |
| 67 | + path: ${{ env.ARDUINOCORE_API_STAGING_PATH }} |
| 68 | + |
| 69 | + - name: Install ArduinoCore-API |
| 70 | + # this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used |
| 71 | + run: | |
| 72 | + mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino" |
| 73 | +
|
| 74 | + - name: Compile examples |
| 75 | + uses: arduino/compile-sketches@main |
| 76 | + with: |
| 77 | + cli-version: 'arduino_threads' |
| 78 | + fqbn: ${{ matrix.fqbn }} |
| 79 | + libraries: | |
| 80 | + ${{ env.UNIVERSAL_LIBRARIES }} |
| 81 | + platforms: | |
| 82 | + # Use Board Manager to install the latest release of Arduino mbed Boards to get the toolchain |
| 83 | + - name: "arduino:mbed" |
| 84 | + # Overwrite the Board Manager installation with the local platform |
| 85 | + - source-path: "extras/ArduinoCore-mbed" |
| 86 | + name: "arduino:mbed" |
| 87 | + sketch-paths: | |
| 88 | + ${{ env.UNIVERSAL_SKETCH_PATHS }} |
| 89 | + enable-deltas-report: 'true' |
| 90 | + verbose: 'true' |
| 91 | + |
| 92 | + - name: Save memory usage change report as artifact |
| 93 | + if: github.event_name == 'pull_request' |
| 94 | + uses: actions/upload-artifact@v2 |
| 95 | + with: |
| 96 | + name: 'size-deltas-reports' |
| 97 | + path: 'size-deltas-reports' |
0 commit comments