-
Notifications
You must be signed in to change notification settings - Fork 124
86 lines (77 loc) · 2.85 KB
/
arduino-compile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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: esp32
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:
- fqbn: "arduino:avr:nano"
platform-name: avr:nano
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 }}