-
-
Notifications
You must be signed in to change notification settings - Fork 64
Add CI workflows #81
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
Add CI workflows #81
Changes from 12 commits
7e4c423
48cdeda
b2ea934
c654b79
9497c8c
cfd3a8d
ce359ad
d68d967
95445d2
9f728df
39e1395
fb15914
72cd7c0
945db37
964531a
c9587a2
a18eccc
283703a
0eb5c64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,117 @@ | ||||||||||||||||||
name: Compile Examples | ||||||||||||||||||
|
||||||||||||||||||
on: [pull_request, push] | ||||||||||||||||||
|
||||||||||||||||||
jobs: | ||||||||||||||||||
compile-test: | ||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||
|
||||||||||||||||||
env: | ||||||||||||||||||
# libraries to install for all boards | ||||||||||||||||||
UNIVERSAL_LIBRARIES: '"MFRC522" "Servo" "LiquidCrystal"' | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This environment variable is unused and these libraries are defined in the |
||||||||||||||||||
# sketch paths to compile (recursive) for all boards | ||||||||||||||||||
UNIVERSAL_SKETCH_PATHS: | | ||||||||||||||||||
- extras/examples | ||||||||||||||||||
- libraries/Wire | ||||||||||||||||||
- libraries/SPI | ||||||||||||||||||
- libraries/SoftwareSerial | ||||||||||||||||||
- libraries/EEPROM | ||||||||||||||||||
- ~/Arduino/libraries/Servo/examples | ||||||||||||||||||
- ~/Arduino/libraries/LiquidCrystal/examples | ||||||||||||||||||
- ~/Arduino/libraries/MFRC522/examples | ||||||||||||||||||
- ~/Arduino/libraries/Ethernet/examples | ||||||||||||||||||
- ~/Arduino/libraries/Arduino_LSM9DS1/examples | ||||||||||||||||||
- ~/Arduino/libraries/SD/examples | ||||||||||||||||||
- ~/Arduino/libraries/Arduino_JSON/examples | ||||||||||||||||||
- ~/Arduino/libraries/WiFi/examples | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can tell, some of the libraries listed in the One option would be to just use the root of the libraries folder as the sketch path: - ~/Arduino/libraries The only problem with that is that maybe you have library dependencies of libraries or sketches installed there and you don't want to compile the examples of those libraries. |
||||||||||||||||||
|
||||||||||||||||||
strategy: | ||||||||||||||||||
fail-fast: false | ||||||||||||||||||
|
||||||||||||||||||
matrix: | ||||||||||||||||||
board: [ | ||||||||||||||||||
{"fqbn": "arduino:megaavr:uno2018", "type": "unoWiFiRev2"}, | ||||||||||||||||||
{"fqbn": "arduino:megaavr:nona4809", "type": "nanoEvery"} | ||||||||||||||||||
] | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
A few suggestions combined here:
|
||||||||||||||||||
|
||||||||||||||||||
steps: | ||||||||||||||||||
- name: Checkout repository | ||||||||||||||||||
uses: actions/checkout@v2 | ||||||||||||||||||
|
||||||||||||||||||
# The source files are in a subfolder of the ArduinoCore-API repository, so it's not possible to clone it directly to the final destination in the core | ||||||||||||||||||
- name: Checkout ArduinoCore-API | ||||||||||||||||||
uses: actions/checkout@v2 | ||||||||||||||||||
with: | ||||||||||||||||||
repository: arduino/ArduinoCore-API | ||||||||||||||||||
path: extras/ArduinoCore-API | ||||||||||||||||||
|
||||||||||||||||||
- name: Install ArduinoCore-API | ||||||||||||||||||
run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino" | ||||||||||||||||||
|
||||||||||||||||||
- name: Checkout Adafruit WiFiNINA | ||||||||||||||||||
uses: actions/checkout@v2 | ||||||||||||||||||
with: | ||||||||||||||||||
repository: adafruit/WiFiNINA | ||||||||||||||||||
path: adafruit/WiFiNINA | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for this? |
||||||||||||||||||
|
||||||||||||||||||
- name: Checkout Basic examples | ||||||||||||||||||
uses: actions/checkout@v2 | ||||||||||||||||||
with: | ||||||||||||||||||
repository: arduino/arduino-examples | ||||||||||||||||||
path: extras | ||||||||||||||||||
|
||||||||||||||||||
- name: Delete incompatible examples | ||||||||||||||||||
run: rm -r "$GITHUB_WORKSPACE/extras/examples/09.USB" && rm -r "$GITHUB_WORKSPACE/extras/examples/10.StarterKit_BasicKit/p11_CrystalBall" && rm -r "$GITHUB_WORKSPACE/extras/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp" | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this is a little easier to read and maintain. The GitHub Actions shell runs in I do have a question about the removal of the p11_CrystalBall example. This isn't really incompatible, is it? I know it was failing to compile due to a bug (arduino/Arduino#10025), but that bug has already been fixed (arduino/ArduinoCore-API@7f8de58). I just gave it a try with my Uno WiFi Rev2 and the updated ArduinoCore-API and it works fine for me. I also have a suggestion about the p13_TouchSensorLamp sketch. I'm guessing in this case it's not about a fundamental incompatibility (such as the hardware incompatibility with the USB examples), but simply that nobody has gotten around to adding support for megaAVR to the CapacitiveSensor library. If so, I would recommend adding a comment to that effect (ideally referencing an issue used to track any progress on adding compatibility). That way, it will be clear that the line removing that example can be removed once the library finally does become compatible. This new one command per line format facilitates adding comments. |
||||||||||||||||||
|
||||||||||||||||||
- name: Compile examples | ||||||||||||||||||
uses: arduino/actions/libraries/compile-examples@master | ||||||||||||||||||
with: | ||||||||||||||||||
fqbn: ${{ matrix.board.fqbn }} | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This goes along with my matrix restructuring suggestion above. |
||||||||||||||||||
libraries: | | ||||||||||||||||||
- name: Adafruit IO Arduino | ||||||||||||||||||
- name: Adafruit MQTT Library | ||||||||||||||||||
- name: ArduinoHttpClient | ||||||||||||||||||
- name: Adafruit FONA Library | ||||||||||||||||||
- name: MegunoLink | ||||||||||||||||||
- name: Servo | ||||||||||||||||||
- name: LiquidCrystal | ||||||||||||||||||
- name: MFRC522 | ||||||||||||||||||
- name: Ethernet | ||||||||||||||||||
- name: ArduinoBearSSL | ||||||||||||||||||
- name: Arduino_LSM9DS1 | ||||||||||||||||||
- name: ArduinoHttpClient | ||||||||||||||||||
- name: NTPClient | ||||||||||||||||||
- name: TFT | ||||||||||||||||||
- name: ArduinoMqttClient | ||||||||||||||||||
- name: Arduino_CRC32 | ||||||||||||||||||
- name: Arduino_LSM6DS3 | ||||||||||||||||||
- name: Stepper | ||||||||||||||||||
- name: SD | ||||||||||||||||||
- name: Arduino_JSON | ||||||||||||||||||
- name: Arduino_HTS221 | ||||||||||||||||||
- name: Firmata | ||||||||||||||||||
- name: ArduinoCloudThing | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This library is obsolete. |
||||||||||||||||||
- name: Arduino_DebugUtils | ||||||||||||||||||
- name: Arduino_LPS22HB | ||||||||||||||||||
- name: ArduinoIoTCloudBearSSL | ||||||||||||||||||
- name: ArduinoDMX | ||||||||||||||||||
- name: ArduinoRS485 | ||||||||||||||||||
- name: Arduino_OAuth | ||||||||||||||||||
- name: WiFi | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The WiFi library is for use with the long retired Arduino WiFi Shield, which is probably not used by anyone any more. So I'm not sure it's worth testing the megaAVR boards platform against it. On the other hand, I would suggest testing the WiFiNINA library's examples, which is not currently done by this workflow. |
||||||||||||||||||
- name: Bridge | ||||||||||||||||||
- name: Temboo | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm uncertain about the value of testing against these. I'm sure you could put a Yun shield on an Uno WiFi Rev2, in which case the Bridge library would be needed, but it doesn't seem like it would be a common use case. Although It should be possible to use the Temboo library with the WiFiNINA library (though you won't find any information about this anywhere in the Temboo documentation or wizards), the Temboo library example sketches are all written for the Yun. |
||||||||||||||||||
platforms: | | ||||||||||||||||||
# Use Board Manager to install the latest release of Arduino megaAVR Boards to get the toolchain | ||||||||||||||||||
- name: "arduino:megaavr" | ||||||||||||||||||
# Overwrite the Board Manager installation with the local platform | ||||||||||||||||||
- source-path: "./" | ||||||||||||||||||
name: "arduino:megaavr" | ||||||||||||||||||
sketch-paths: "${{ env.UNIVERSAL_SKETCH_PATHS }}" | ||||||||||||||||||
enable-size-deltas-report: 'true' | ||||||||||||||||||
verbose: 'true' | ||||||||||||||||||
|
||||||||||||||||||
- name: Save memory usage change report as artifact | ||||||||||||||||||
uses: actions/upload-artifact@v1 | ||||||||||||||||||
with: | ||||||||||||||||||
name: size-deltas-reports | ||||||||||||||||||
path: size-deltas-reports |
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/actions/libraries/report-size-deltas@master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes the workflow to only run when a file relevant to sketch compilation, or the workflow itself, is modified:
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths