-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[CI] External libraries compilation test #8003
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
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
4ae7b80
Workflow final + docs added
P-R-O-C-H-Y c2ac6ad
Merge branch 'master' into Libraries_CI_test
P-R-O-C-H-Y 1ecb751
fix readme links
P-R-O-C-H-Y b5f5904
added JSON + lib_v2 YAML
P-R-O-C-H-Y 633e41f
Update lib_v2.yml
P-R-O-C-H-Y 8b8c837
Update lib_v2.yml
P-R-O-C-H-Y 83e0d38
Update lib_v2.yml
P-R-O-C-H-Y dcd0c1f
Update lib_v2.yml
P-R-O-C-H-Y ef3a49b
Update lib_v2.yml
P-R-O-C-H-Y 085497f
Update lib_v2.yml
P-R-O-C-H-Y aabadd1
Update lib_v2.yml
P-R-O-C-H-Y 0568603
update JSON file
P-R-O-C-H-Y 86a4bea
Added json file
P-R-O-C-H-Y a883b8d
Update lib.yml
P-R-O-C-H-Y 1d7f186
Update lib_v2.yml
P-R-O-C-H-Y 2d5bb5c
Update lib_v2.yml
P-R-O-C-H-Y e3013f8
change JSON
P-R-O-C-H-Y 884f7fe
edit json + add version
P-R-O-C-H-Y c1ac969
edit json
P-R-O-C-H-Y 4d7fc3f
update version
P-R-O-C-H-Y 69d3745
fix path
P-R-O-C-H-Y a730253
update fqbn platform name
P-R-O-C-H-Y 123dad1
add empty test result file
P-R-O-C-H-Y 1e3306f
Add latest changes
P-R-O-C-H-Y daefd2f
Update docs
P-R-O-C-H-Y b5d098a
Update docs + clean YAML fifle
P-R-O-C-H-Y ee3c674
Add ESPAsyncWebServer library
P-R-O-C-H-Y 74dc8f0
Add test multiple required libs (will revert)
P-R-O-C-H-Y b198f93
Update docs + json
P-R-O-C-H-Y ff9fab0
Merge branch 'master' into Libraries_CI_test
P-R-O-C-H-Y ec94184
Update lib.yml
P-R-O-C-H-Y 9bef9af
Fix typos in docs
P-R-O-C-H-Y 9503e0a
fix readme links
P-R-O-C-H-Y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[ | ||
{ | ||
"name": "Adafruit NeoPixel", | ||
"version": "1.10.6", | ||
"exclude_targets": [], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/Adafruit_NeoPixel/examples/strandtest/strandtest.ino" | ||
] | ||
}, | ||
{ | ||
"name": "ArduinoBLE", | ||
"exclude_targets": [ | ||
"esp32s2" | ||
], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/ArduinoBLE/examples/Central/Scan/Scan.ino" | ||
] | ||
}, | ||
{ | ||
"name": "ESP32Servo", | ||
"exclude_targets": [], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/ESP32Servo/examples/Knob/Knob.ino", | ||
"~/Arduino/libraries/ESP32Servo/examples/Sweep/Sweep.ino", | ||
"~/Arduino/libraries/ESP32Servo/examples/PWMExample/PWMExample.ino", | ||
"~/Arduino/libraries/ESP32Servo/examples/Multiple-Servo-Example-Arduino/Multiple-Servo-Example-Arduino.ino" | ||
] | ||
}, | ||
{ | ||
"source-url": "https://github.com/me-no-dev/ESPAsyncWebServer.git", | ||
"required-libs": [ | ||
{"source-url": "https://github.com/me-no-dev/AsyncTCP.git"} | ||
], | ||
"exclude_targets": [], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino", | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino", | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino", | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/simple_server/simple_server.ino" | ||
] | ||
}, | ||
{ | ||
"name": "FastLED", | ||
"exclude_targets": [], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/FastLED/examples/Blink/Blink.ino" | ||
] | ||
}, | ||
{ | ||
"name": "IRremote", | ||
"exclude_targets": [], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/IRremote/examples/SendDemo/SendDemo.ino" | ||
] | ||
} | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: External Libraries Test | ||
|
||
# The workflow will run on schedule and labeled pull requests | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, labeled] | ||
|
||
# Schedule weekly builds on every Sunday at 4 am | ||
schedule: | ||
- cron: '0 4 * * SUN' | ||
|
||
env: | ||
# It's convenient to set variables for values used multiple times in the workflow | ||
SKETCHES_REPORTS_PATH: libraries-report | ||
SKETCHES_REPORTS_ARTIFACT_NAME: libraries-report | ||
RESULT_LIBRARY_TEST_FILE: LIBRARIES_TEST.md | ||
JSON_LIBRARY_LIST_FILE: .github/workflows/lib.json | ||
jobs: | ||
compile-sketch: | ||
if: | | ||
contains(github.event.pull_request.labels.*.name, 'lib_test') || | ||
(github.event_name == 'schedule' && github.repository == 'espressif/arduino-esp32') | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
REPOSITORY: | | ||
- source-path: '.' | ||
name: "espressif:esp32" | ||
|
||
strategy: | ||
matrix: | ||
target: | ||
- esp32 | ||
- esp32s2 | ||
- esp32c3 | ||
- esp32s3 | ||
|
||
include: | ||
- target: esp32 | ||
fqbn: espressif:esp32:esp32 | ||
- target: esp32s2 | ||
fqbn: espressif:esp32:esp32s2 | ||
- target: esp32c3 | ||
fqbn: espressif:esp32:esp32c3 | ||
- target: esp32s3 | ||
fqbn: espressif:esp32:esp32s3 | ||
|
||
|
||
steps: | ||
# This step makes the contents of the repository available to the workflow | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Compile sketch | ||
uses: P-R-O-C-H-Y/compile-sketches@main | ||
with: | ||
platforms: | | ||
${{ env.REPOSITORY }} | ||
target: ${{ matrix.target }} | ||
fqbn: ${{ matrix.fqbn }} | ||
use-json-file: true | ||
json-path: ${{ env.JSON_LIBRARY_LIST_FILE }} | ||
enable-deltas-report: true | ||
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} | ||
enable-warnings-report: true | ||
cli-compile-flags: | | ||
- --warnings="all" | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} | ||
path: ${{ env.SKETCHES_REPORTS_PATH }} | ||
|
||
report-comment: | ||
needs: compile-sketch # Wait for the compile job to finish to get the data for the report | ||
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request | ||
runs-on: ubuntu-latest | ||
steps: | ||
# This step is needed to get the size data produced by the compile jobs | ||
- name: Download sketches reports artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} | ||
path: ${{ env.SKETCHES_REPORTS_PATH }} | ||
|
||
- name: Report results | ||
uses: P-R-O-C-H-Y/report-size-deltas@main | ||
with: | ||
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} | ||
|
||
report-to-file: | ||
needs: compile-sketch # Wait for the compile job to finish to get the data for the report | ||
if: github.event_name == 'schedule' # Only run the job when the workflow is triggered by a schedule | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Check out repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# This step is needed to get the size data produced by the compile jobs | ||
- name: Download sketches reports artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} | ||
path: ${{ env.SKETCHES_REPORTS_PATH }} | ||
|
||
- name: Report results | ||
uses: P-R-O-C-H-Y/report-size-deltas@main | ||
with: | ||
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} | ||
destination-file: ${{ env.RESULT_LIBRARY_TEST_FILE }} | ||
|
||
- name: Append file with action URL | ||
uses: DamianReeves/write-file-action@master | ||
with: | ||
path: ${{ env.RESULT_LIBRARY_TEST_FILE }} | ||
contents: | | ||
/ [GitHub Action Link](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) | ||
write-mode: append | ||
|
||
- name: Push to github repo | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add ${{ env.RESULT_LIBRARY_TEST_FILE }} | ||
git commit -m "Generated External Libraries Test Results" | ||
git push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Empty file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
########################## | ||
External Libraries Testing | ||
########################## | ||
|
||
About | ||
----- | ||
|
||
External libraries testing is a compilation test for listed libraries on arduino-esp32 master branch. The test was made for users, so they can check which libraries are compiling without errors on which SoC. | ||
External libraries test is running periodicaly (once a week) agains master branch and can also run on PR by adding a label ``lib_test``. | ||
P-R-O-C-H-Y marked this conversation as resolved.
Show resolved
Hide resolved
|
||
The test is running on all supported ESP32 chips. | ||
|
||
.. note:: | ||
As the test is just a compilation of example, that does not guarrantee that the library/sketch will run without any problems after flashing it on your device. | ||
P-R-O-C-H-Y marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
How to Add Library to Test | ||
-------------------------- | ||
|
||
To add a library to the CI test you need to add your library to the `lib.json`_. file located in ``./github/workflows/``. | ||
|
||
.. note:: | ||
Please add the libraries to the `lib.json`_ in alphabetical order, thanks. | ||
|
||
List of parameters: | ||
******************* | ||
|
||
Where the library will be installed from (use only 1 option): | ||
|
||
* ``name`` - Name of the Library in Arduino Library Manager. | ||
* ``source-url`` - URL to the library github repository (example: "https://github.com/Arduino-IRremote/Arduino-IRremote.git"). Use when your Library is not listed in Arduino Library Manager. | ||
|
||
Required: | ||
|
||
* ``exclude_targets`` - List of targets to be excluded from testing. Use only when the SoC dont support used peripheral. | ||
* ``sketch_path`` - Path / paths to the sketch / sketches to be tested. | ||
|
||
Optional: | ||
|
||
* ``version`` - Version of the library. | ||
* ``required-libs`` - Libraries that are necessary to be installed to compile the tested library. | ||
* ``destination-name`` - Folder name used for the installation of library (use only when needed). | ||
|
||
|
||
Example of library addition from Arduino Library Manager with ESP32-S2 excluded: | ||
******************************************************************************** | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"name": "ArduinoBLE", | ||
"exclude_targets": [ | ||
"esp32s2" | ||
], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/ArduinoBLE/examples/Central/Scan/Scan.ino" | ||
] | ||
} | ||
|
||
Example of library addition from Github URL with required library: | ||
****************************************************************** | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"source-url": "https://github.com/me-no-dev/ESPAsyncWebServer.git", | ||
"required-libs": [ | ||
{"source-url": "https://github.com/me-no-dev/AsyncTCP.git"} | ||
], | ||
"exclude_targets": [], | ||
"sketch_path": [ | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino", | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino", | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino", | ||
"~/Arduino/libraries/ESPAsyncWebServer/examples/simple_server/simple_server.ino" | ||
] | ||
}, | ||
|
||
Sumbit a PR | ||
P-R-O-C-H-Y marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*********** | ||
|
||
* Open a PR with the changes and someone from Espressif team will add a label ``lib_test`` to the PR and CI will run the test to check, if the addition is fine and library / example are compiling. | ||
P-R-O-C-H-Y marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* After merging your PR, the next scheduled test will test your library and add the results to the `LIBRARIES_TEST.md`_. | ||
|
||
Test Results | ||
------------ | ||
|
||
Icons meaning | ||
************* | ||
|
||
There is a number before each icon, which means the number of examples which were compiled with that result. | ||
|
||
* |success| - Compilation was successful. | ||
|
||
* |warning| - Compilation was successful, but some warnings occurs. | ||
|
||
* |fail| - Compilation failed. | ||
|
||
* ``N/A`` - Not tested (target is in exclude_targets list). | ||
|
||
Scheduled test result | ||
********************* | ||
|
||
You can check the results in `LIBRARIES_TEST.md`_. | ||
|
||
The results file example: | ||
|
||
.. image:: _static/external_library_test_schedule.png | ||
:width: 600 | ||
|
||
Pull Request test result | ||
************************ | ||
|
||
If the test run on Pull Request, it will compile all libraries and sketches 2 times (before/after changes in PR) to see, if the PR is breaking/fixing libraries. | ||
In the table the results are in order ``BEFORE -> AFTER``. | ||
|
||
.. image:: _static/external_library_test_pr.png | ||
:width: 600 | ||
|
||
.. |success| image:: _static/green_checkmark.png | ||
:height: 2ex | ||
:class: no-scaled-link | ||
|
||
.. |warning| image:: _static/warning.png | ||
:height: 2ex | ||
:class: no-scaled-link | ||
|
||
.. |fail| image:: _static/cross.png | ||
:height: 2ex | ||
:class: no-scaled-link | ||
|
||
.. _LIBRARIES_TEST.md: https://github.com/espressif/arduino-esp32/LIBRARIES_TEST.md | ||
.. _lib.json: https://github.com/espressif/arduino-esp32/.github/workflow/lib.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.