Skip to content

Commit 9aab1ae

Browse files
giulcioffiper1234
andauthored
Add CI workflow (#13)
Co-authored-by: per1234 <[email protected]>
1 parent 8effef0 commit 9aab1ae

10 files changed

+120
-11
lines changed
+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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'
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Report PR Size Deltas
2+
3+
on:
4+
schedule:
5+
- cron: '*/5 * * * *'
6+
7+
jobs:
8+
report:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Comment size deltas reports to PRs
13+
uses: arduino/report-size-deltas@main

examples/SharedResourcesVariousLibraries/SharedResourcesVariousLibraries.ino

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
void setup() {
32
Serial.begin(115200);
43
while (!Serial);
@@ -11,10 +10,10 @@ void setup() {
1110
// every N milliseconds without waiting for EOL (for this thread only)
1211
//Serial.raw();
1312

14-
TempReader.begin();
15-
SerialReader.begin();
16-
GetRandom.begin();
17-
Accelerometer.begin();
13+
TempReader.start();
14+
SerialReader.start();
15+
GetRandom.start();
16+
Accelerometer.start();
1817
}
1918

2019
void loop() {

examples/i2c_concurrent/i2c_concurrent.ino

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
#include "arduino_threads.h"
2-
#include "variables.h"
31
#include "Wire.h"
42
#include "SerialDispatcher.h"
53

64
/* this part should be autogenerated */
5+
/*
76
THD_ENTER(temp_reader)
87
#include "temp_reader.h"
98
THD_DONE(temp_reader)
@@ -23,15 +22,16 @@ THD_DONE(ecc_reader)
2322
THD_ENTER(scanner)
2423
#include "scanner.h"
2524
THD_DONE(scanner)
25+
*/
2626

2727
void setup() {
2828
Serial.begin(115200);
2929
while (!Serial);
3030
Serial.tags(true);
31-
temp_reader_obj.start();
32-
pf_reader_obj.start();
33-
scanner_obj.start();
34-
ecc_reader_obj.start();
31+
temp_reader.start();
32+
pf_reader.start();
33+
scanner.start();
34+
ecc_reader.start();
3535
}
3636

3737
void loop() {

0 commit comments

Comments
 (0)