Skip to content

Commit

Permalink
Merge pull request #371 from pennam/ci_examples
Browse files Browse the repository at this point in the history
CI: Add examples and fix build
  • Loading branch information
pennam authored Jul 19, 2023
2 parents 32f8019 + 9cd67c1 commit a6a7952
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
UNIVERSAL_SKETCH_PATHS: |
- examples/ArduinoIoTCloud-Advanced
- examples/ArduinoIoTCloud-Basic
- examples/ArduinoIoTCloud-Callbacks
- examples/ArduinoIoTCloud-Schedule
- examples/utility/ArduinoIoTCloud_Travis_CI
SKETCHES_REPORTS_PATH: sketches-reports

Expand Down Expand Up @@ -97,6 +99,7 @@ jobs:
- name: Arduino_JSON
- source-url: https://github.com/adafruit/Adafruit_SleepyDog.git
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
- examples/utility/SelfProvisioning
- board:
Expand Down Expand Up @@ -146,6 +149,7 @@ jobs:
- name: ArduinoECCX08
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
# Nicla Vision
- board:
Expand All @@ -156,6 +160,7 @@ jobs:
libraries: |
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
# Opta
- board:
Expand All @@ -167,6 +172,7 @@ jobs:
- name: ArduinoECCX08
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
# GIGA
- board:
Expand All @@ -178,6 +184,7 @@ jobs:
- name: ArduinoECCX08
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
# Portenta C33
- board:
Expand Down Expand Up @@ -213,7 +220,8 @@ jobs:
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
libraries: |
- name: Arduino_ESP32_OTA
sketch-paths:
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
steps:
- name: Checkout
Expand Down
23 changes: 11 additions & 12 deletions examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void setup() {
*/
void setupOneShotSchedule() {

ScheduleTimeType startingFrom = TimeService::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType startingFrom = TimeServiceClass::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = startingFrom + ( DAYS * 1 );
ScheduleTimeType activePeriod = MINUTES * 5;

Expand All @@ -74,7 +74,7 @@ void setupOneShotSchedule() {
*/
void setupMinuteSchedule() {

ScheduleTimeType startingFrom = TimeService::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType startingFrom = TimeServiceClass::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = startingFrom + ( DAYS * 1 );
ScheduleTimeType activePeriod = SECONDS * 15;
unsigned int repetitionPeriod = 1;
Expand All @@ -91,8 +91,8 @@ void setupMinuteSchedule() {
*/
void setupHourlySchedule() {

ScheduleTimeType startingFrom = TimeService::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = TimeService::getTimeFromString("2021 Nov 15 13:00:00");
ScheduleTimeType startingFrom = TimeServiceClass::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = TimeServiceClass::getTimeFromString("2021 Nov 15 13:00:00");
ScheduleTimeType activePeriod = MINUTES * 20;
unsigned int repetitionPeriod = 1;

Expand All @@ -108,8 +108,8 @@ void setupHourlySchedule() {
*/
void setupDailySchedule() {

ScheduleTimeType startingFrom = TimeService::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = TimeService::getTimeFromString("2021 Nov 15 13:00:00");
ScheduleTimeType startingFrom = TimeServiceClass::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = TimeServiceClass::getTimeFromString("2021 Nov 15 13:00:00");
ScheduleTimeType activePeriod = HOURS * 2;
unsigned int repetitionPeriod = 1;

Expand All @@ -133,7 +133,7 @@ void setupDailySchedule() {
*/
void setupWeeklySchedule() {

unsigned int startingFrom = TimeService::getTimeFromString("2021 Nov 01 17:00:00");
unsigned int startingFrom = TimeServiceClass::getTimeFromString("2021 Nov 01 17:00:00");
unsigned int until = startingFrom + ( DAYS * 30 );
unsigned int executionPeriod = MINUTES * 3;

Expand All @@ -158,8 +158,8 @@ void setupWeeklySchedule() {
*/
void setupMonthlySchedule() {

ScheduleTimeType startingFrom = TimeService::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = TimeService::getTimeFromString("2021 Nov 15 13:00:00");
ScheduleTimeType startingFrom = TimeServiceClass::getTimeFromString("2021 Nov 01 17:00:00");
ScheduleTimeType until = TimeServiceClass::getTimeFromString("2021 Nov 15 13:00:00");
ScheduleTimeType activePeriod = DAYS * 1;
int dayOfMonth = 3;

Expand All @@ -175,8 +175,8 @@ void setupMonthlySchedule() {
*/
void setupYearlySchedule() {

ScheduleTimeType startingFrom = TimeService::getTimeFromString("2021 Nov 06 17:00:00");
ScheduleTimeType until = TimeService::getTimeFromString("2041 Nov 06 13:00:00");
ScheduleTimeType startingFrom = TimeServiceClass::getTimeFromString("2021 Nov 06 17:00:00");
ScheduleTimeType until = TimeServiceClass::getTimeFromString("2041 Nov 06 13:00:00");
ScheduleTimeType activePeriod = DAYS * 2;
int dayOfMonth = 6;

Expand Down Expand Up @@ -222,4 +222,3 @@ void loop() {
}

}

2 changes: 1 addition & 1 deletion examples/ArduinoIoTCloud-Schedule/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void initProperties() {
ArduinoCloud.addProperty(monthly, READWRITE, ON_CHANGE);
ArduinoCloud.addProperty(yearly, READWRITE, ON_CHANGE);
#elif defined(BOARD_HAS_LORA)
ArduinoCloud.addProperty(switchButton, 1, WRITE, ON_CHANGE;
ArduinoCloud.addProperty(switchButton, 1, WRITE, ON_CHANGE);
#endif
}

Expand Down

0 comments on commit a6a7952

Please sign in to comment.