-
Notifications
You must be signed in to change notification settings - Fork 3
110 lines (98 loc) · 3.95 KB
/
compile-examples.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Compile Examples
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "library.properties"
- "examples/**"
- "src/**"
push:
paths:
- ".github/workflows/compile-examples.yml"
- "library.properties"
- "examples/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:
env:
SKETCHES_REPORTS_PATH: sketches-reports
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
jobs:
compile-test:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest
env:
# libraries to install for all boards
UNIVERSAL_LIBRARIES: |
# Install the Arduino_Threads library from the repository
- source-path: ./
# sketch paths to compile (recursive) for all boards
UNIVERSAL_SKETCH_PATHS: |
- examples
ARDUINOCORE_MBED_STAGING_PATH: extras/ArduinoCore-mbed
ARDUINOCORE_API_STAGING_PATH: extras/ArduinoCore-API
strategy:
fail-fast: false
matrix:
board:
- fqbn: arduino:mbed_nano:nano33ble
platforms: |
- name: arduino:mbed_nano
artifact-name-suffix: arduino-mbed_nano-nano33ble
- fqbn: arduino:mbed_nano:nanorp2040connect
platforms: |
- name: arduino:mbed_nano
artifact-name-suffix: arduino-mbed_nano-nanorp2040connect
- fqbn: arduino:mbed_portenta:envie_m7:target_core=cm4
platforms: |
- name: arduino:mbed_portenta
artifact-name-suffix: arduino-mbed_portenta-envie_m7-target_core-cm4
- fqbn: arduino:mbed_portenta:envie_m7:target_core=cm7
platforms: |
- name: arduino:mbed_portenta
artifact-name-suffix: arduino-mbed_portenta-envie_m7
steps:
- name: Checkout
uses: actions/checkout@v4
# it's necessary to checkout the platform before installing it so that the ArduinoCore-API dependency can be added
- name: Checkout ArduinoCore-mbed
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
uses: actions/checkout@v4
with:
repository: arduino/ArduinoCore-mbed
# the arduino/actions/libraries/compile-examples action will install the platform from this path
path: ${{ env.ARDUINOCORE_MBED_STAGING_PATH }}
- name: Checkout ArduinoCore-API
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
uses: actions/checkout@v4
with:
repository: arduino/ArduinoCore-API
path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}
- name: Install ArduinoCore-API
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
run: |
mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino"
- name: Compile examples
uses: arduino/compile-sketches@v1
with:
cli-version: 'arduino_threads'
fqbn: ${{ matrix.board.fqbn }}
libraries: |
${{ env.UNIVERSAL_LIBRARIES }}
platforms: ${{ matrix.board.platforms }}
sketch-paths: |
${{ env.UNIVERSAL_SKETCH_PATHS }}
enable-deltas-report: 'true'
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
github-token: ${{ secrets.GITHUB_TOKEN }}
verbose: 'true'
- name: Save memory usage change report as artifact
uses: actions/upload-artifact@v4
with:
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}