-
-
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
Conversation
…t as artifact' step
@@ -0,0 +1,117 @@ | |||
name: Compile Examples | |||
|
|||
on: [pull_request, push] |
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.
on: [pull_request, push] | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/compile-examples.yml" | |
- "cores/**" | |
- "libraries/**" | |
- "variants/**" | |
- "boards.txt" | |
- "platform.txt" | |
push: | |
paths: | |
- ".github/workflows/compile-examples.yml" | |
- "cores/**" | |
- "libraries/**" | |
- "variants/**" | |
- "boards.txt" | |
- "platform.txt" |
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
# libraries to install for all boards | ||
UNIVERSAL_LIBRARIES: '"MFRC522" "Servo" "LiquidCrystal"' |
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.
# libraries to install for all boards | |
UNIVERSAL_LIBRARIES: '"MFRC522" "Servo" "LiquidCrystal"' |
This environment variable is unused and these libraries are defined in the arduino/actions/libraries/compile-examples
action's libraries
input. So this can be removed to avoid confusion.
- ~/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 comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell, some of the libraries listed in the arduino/actions/libraries/compile-examples
action's libraries
input are not being used for anything because they aren't in this list and they aren't dependencies of anything in this list.
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
board: [ | |
{"fqbn": "arduino:megaavr:uno2018", "type": "unoWiFiRev2"}, | |
{"fqbn": "arduino:megaavr:nona4809", "type": "nanoEvery"} | |
] | |
fqbn: | |
- "arduino:megaavr:uno2018:mode=on" | |
- "arduino:megaavr:uno2018:mode=off" | |
- "arduino:megaavr:nona4809" |
A few suggestions combined here:
- The
type
keys were not being used, so I removed them. - I find the YAML-style list format to be easier to understand in the context of the style of the rest of the document.
- Test the `"Registers emulation" board option.
- 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 comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this?
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 comment
The reason will be displayed to describe this comment to others. Learn more.
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" | |
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" |
I think this is a little easier to read and maintain. The GitHub Actions shell runs in errexit
exit mode, so there is no functional difference.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
fqbn: ${{ matrix.board.fqbn }} | |
fqbn: ${{ matrix.fqbn }} |
This goes along with my matrix restructuring suggestion above.
- name: Arduino_JSON | ||
- name: Arduino_HTS221 | ||
- name: Firmata | ||
- name: ArduinoCloudThing |
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.
- name: ArduinoCloudThing |
This library is obsolete.
- name: ArduinoDMX | ||
- name: ArduinoRS485 | ||
- name: Arduino_OAuth | ||
- name: WiFi |
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.
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 comment
The 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.
Hi @giulcioffi and @per1234 👋 Thank you @giulcioffi for creating this PR as well as @per1234 for doing a in-detail review. May I ask you to stick your heads together to finish this PR up so we can merge it? |
…evant to sketch compilation
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.
Great work @giulcioffi. I'm really excited for this being added to the ArduinoCore-megaavr repository!
The
compile-examples
workflow compiles:Memory usage information collection is always enabled and handled by the
report-size-deltas
workflow.With the current version of the core, the compilation of the following libraries examples will fail:
Their failure is due to issue F() Flash Macro No Longer Recognized #62 . Once the F macro will be fixed, the compilation of these examples will be successful.