Skip to content

Add CI workflow #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Compile Examples

on:
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
push:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"

jobs:
compile-test:
runs-on: ubuntu-latest

env:
# libraries to install for all boards
UNIVERSAL_LIBRARIES: |
# Install the ArduinoThreads library from the repository
- source-path: ./
- name: Arduino_LSM9DS1
- name: Arduino_APDS9960
- name: ArduinoECCX08
- name: Arduino_HTS221
- name: OneWire
# 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:
fqbn:
- "arduino-beta:mbed:nano33ble"
# - "arduino-beta:mbed:envie_m4"
- "arduino-beta:mbed:envie_m7"

steps:
- name: Checkout
uses: actions/checkout@v2

# 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@v2
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: Remove ArduinoCore-API symlink from Arduino mbed-Enabled Boards platform
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
run: rm "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino/api"

- 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@v2
with:
repository: arduino/ArduinoCore-API
# as specified at https://github.com/arduino/ArduinoCore-mbed/blob/master/README.md#installation
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/actions/libraries/compile-examples@master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: arduino/actions/libraries/compile-examples@master
uses: arduino/compile-sketches@main

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :) done!

with:
cli-version: 'arduino_threads'
fqbn: ${{ matrix.fqbn }}
libraries: |
${{ env.UNIVERSAL_LIBRARIES }}
platforms: |
# Use Board Manager to install the latest release of Arduino mbed Boards to get the toolchain
- name: "arduino-beta:mbed"
# Overwrite the Board Manager installation with the local platform
- source-path: "extras/ArduinoCore-mbed"
name: "arduino-beta:mbed"
sketch-paths: |
${{ env.UNIVERSAL_SKETCH_PATHS }}
enable-deltas-report: 'true'
verbose: 'true'

- name: Save memory usage change report as artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v1
with:
name: 'size-deltas-reports'
path: 'size-deltas-reports'
13 changes: 13 additions & 0 deletions .github/workflows/report-size-deltas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Report PR Size Deltas

on:
schedule:
- cron: '*/5 * * * *'

jobs:
report:
runs-on: ubuntu-latest

steps:
- name: Comment size deltas reports to PRs
uses: arduino/report-size-deltas@main
2 changes: 1 addition & 1 deletion examples/Leds/Leds.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
void setup() {
// put your setup code here, to run once:
pinMode(LEDR, OUTPUT);
ledblue_obj.start();
ledblue.start();
}

void loop() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

void setup() {
Serial.begin(115200);
while (!Serial);
Expand All @@ -11,10 +10,10 @@ void setup() {
// every N milliseconds without waiting for EOL (for this thread only)
//Serial.raw();

TempReader.begin();
SerialReader.begin();
GetRandom.begin();
Accelerometer.begin();
TempReader.start();
SerialReader.start();
GetRandom.start();
Accelerometer.start();
}

void loop() {
Expand Down
12 changes: 6 additions & 6 deletions examples/i2c_concurrent/i2c_concurrent.ino
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "arduino_threads.h"
#include "variables.h"
#include "Wire.h"
#include "SerialDispatcher.h"

/* this part should be autogenerated */
/*
THD_ENTER(temp_reader)
#include "temp_reader.h"
THD_DONE(temp_reader)
Expand All @@ -23,15 +22,16 @@ THD_DONE(ecc_reader)
THD_ENTER(scanner)
#include "scanner.h"
THD_DONE(scanner)
*/

void setup() {
Serial.begin(115200);
while (!Serial);
Serial.tags(true);
temp_reader_obj.start();
pf_reader_obj.start();
scanner_obj.start();
ecc_reader_obj.start();
temp_reader.start();
pf_reader.start();
scanner.start();
ecc_reader.start();
}

void loop() {
Expand Down
File renamed without changes.