Skip to content

Some libraries moved to be automatically installed #131

Some libraries moved to be automatically installed

Some libraries moved to be automatically installed #131

name: Compile Arduino Sketches
on:
pull_request:
paths:
- ".github/workflows/arduino-compile.yml"
- "library.properties"
- "examples/**"
- "src/**"
push:
paths:
- ".github/workflows/arduino-compile.yml"
- "library.properties"
- "examples/**"
- "src/**"
workflow_dispatch:
repository_dispatch:
env:
SKETCHES_REPORTS_PATH: sketches-reports
SKETCHES_REPORTS_NAME: arduino
jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest
env:
LIBRARIES: |
# Install the additionally needed dependency from the respository
- source-path: ./
- name: TBPubSubClient
- name: ArduinoHttpClient
- name: ArduinoJson
- name: StreamUtils
- name: WiFiEsp
- name: TinyGSM
strategy:
matrix:
board:
# The possible board types for Arduino can be found here https://github.com/arduino/ArduinoCore-avr/blob/master/.github/workflows/compile-platform-examples.yml
- fqbn: "arduino:avr:mega:cpu=atmega2560"
platform-name: avr:mega
steps:
- uses: actions/checkout@v3
- name: Compile examples
uses: arduino/compile-sketches@v1
with:
platforms: ${{ matrix.platforms }}
fqbn: ${{ matrix.board.fqbn }}
libraries: ${{ env.LIBRARIES }}
enable-deltas-report: true
sketch-paths: |
- examples/0000-arduino_send_telemetry/0000-arduino_send_telemetry.ino
- examples/0001-arduino_send_batch/0001-arduino_send_batch.ino
- examples/0002-arduino_rpc/0002-arduino_rpc.ino
- examples/0004-arduino-sim900_send_telemetry/0004-arduino-sim900_send_telemetry.ino
- examples/0005-arduino-sim900_send_telemetry_http/0005-arduino-sim900_send_telemetry_http.ino
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}/${{ env.SKETCHES_REPORTS_NAME }}
enable-warnings-report: 'true'
- name: Save memory usage change report as artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: ${{ env.SKETCHES_REPORTS_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}/${{ env.SKETCHES_REPORTS_NAME }}
report:
needs: build # Wait for the build job to finish to get the data for the report
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
runs-on: ubuntu-latest
steps:
# This step is needed to get the size data produced by the build jobs
- name: Download sketches reports artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}/${{ env.SKETCHES_REPORTS_NAME }}
- uses: arduino/report-size-deltas@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}/${{ env.SKETCHES_REPORTS_NAME }}