Skip to content

Commit 540ab86

Browse files
committed
Merge branch 'master' into release/v2.x
2 parents e7d3a2f + b98255d commit 540ab86

File tree

39 files changed

+957
-111
lines changed

39 files changed

+957
-111
lines changed

Diff for: .github/scripts/sketch_utils.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,27 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
117117
# 3. Created at the sketch level as "buildX" where X is the number
118118
# of configuration built in case of a multiconfiguration test.
119119

120+
sketchname=$(basename $sketchdir)
121+
120122
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
121123
if [ -n "$ARDUINO_BUILD_DIR" ]; then
122124
build_dir="$ARDUINO_BUILD_DIR"
123125
elif [ $len -eq 1 ]; then
124126
# build_dir="$sketchdir/build"
125-
build_dir="$HOME/.arduino/build.tmp"
127+
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
126128
fi
127129

128130
mkdir -p "$ARDUINO_CACHE_DIR"
129131
for i in `seq 0 $(($len - 1))`
130132
do
131133
if [ $len -ne 1 ]; then
132134
# build_dir="$sketchdir/build$i"
133-
build_dir="$HOME/.arduino/build$i.tmp"
135+
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
134136
fi
135137
rm -rf $build_dir
136138
mkdir -p $build_dir
137139

138140
currfqbn=`echo $fqbn | jq -r --argjson i $i '.[$i]'`
139-
sketchname=$(basename $sketchdir)
140141

141142
if [ -f "$ide_path/arduino-cli" ]; then
142143
echo "Building $sketchname with arduino-cli and FQBN=$currfqbn"
@@ -152,6 +153,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
152153
$xtra_opts "${sketchdir}"
153154
elif [ -f "$ide_path/arduino-builder" ]; then
154155
echo "Building $sketchname with arduino-builder and FQBN=$currfqbn"
156+
echo "Build path = $build_dir"
155157

156158
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
157159
-fqbn=\"$currfqbn\" \

Diff for: .github/scripts/tests_run.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function run_test() {
1515
fi
1616

1717
if [ $len -eq 1 ]; then
18-
build_dir="tests/$sketchname/build"
18+
# build_dir="tests/$sketchname/build"
19+
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
1920
report_file="tests/$sketchname/$sketchname.xml"
2021
fi
2122

@@ -27,7 +28,8 @@ function run_test() {
2728
fi
2829

2930
if [ $len -ne 1 ]; then
30-
build_dir="tests/$sketchname/build$i"
31+
# build_dir="tests/$sketchname/build$i"
32+
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
3133
report_file="tests/$sketchname/$sketchname$i.xml"
3234
fi
3335

Diff for: .github/workflows/hil.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
set -e
4040
rm sketches.txt
4141
CHUNKS=$(jq -c -n '$ARGS.positional' --args `seq 0 1 $((sketches - 1))`)
42-
echo "::set-output name=chunks::${CHUNKS}"
42+
echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT
4343
4444
Build:
4545
needs: gen_chunks
@@ -49,21 +49,20 @@ jobs:
4949
matrix:
5050
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
5151
chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}}
52-
5352
steps:
5453
- name: Checkout Repository
5554
uses: actions/checkout@v3
56-
5755
- name: Build sketches
5856
run: |
5957
bash .github/scripts/tests_build.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}}
6058
- name: Upload ${{matrix.chip}}-${{matrix.chunks}} artifacts
61-
uses: actions/upload-artifact@v2
59+
uses: actions/upload-artifact@v3
6260
with:
6361
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
6462
path: |
65-
tests/*/build*/*.bin
66-
tests/*/build*/*.json
63+
~/.arduino/tests/*/build*.tmp/*.bin
64+
~/.arduino/tests/*/build*.tmp/*.json
65+
if-no-files-found: error
6766
Test:
6867
needs: [gen_chunks, Build]
6968
name: ${{matrix.chip}}-Test#${{matrix.chunks}}
@@ -87,10 +86,10 @@ jobs:
8786
uses: actions/checkout@v3
8887

8988
- name: Download ${{matrix.chip}}-${{matrix.chunks}} artifacts
90-
uses: actions/download-artifact@v2
89+
uses: actions/download-artifact@v3
9190
with:
9291
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
93-
path: tests/
92+
path: ~/.arduino/tests/
9493

9594
- name: Install dependencies
9695
run: |
@@ -103,7 +102,7 @@ jobs:
103102
bash .github/scripts/tests_run.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}} -e
104103
105104
- name: Upload test result artifacts
106-
uses: actions/upload-artifact@v2
105+
uses: actions/upload-artifact@v3
107106
if: always()
108107
with:
109108
name: test_results-${{matrix.chip}}-${{matrix.chunks}}
@@ -118,7 +117,7 @@ jobs:
118117
runs-on: ubuntu-latest
119118
steps:
120119
- name: Upload
121-
uses: actions/upload-artifact@v2
120+
uses: actions/upload-artifact@v3
122121
with:
123122
name: Event File
124123
path: ${{github.event_path}}

Diff for: .github/workflows/lib.json

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[
2+
{
3+
"name": "Adafruit NeoPixel",
4+
"exclude_targets": [],
5+
"sketch_path": [
6+
"~/Arduino/libraries/Adafruit_NeoPixel/examples/strandtest/strandtest.ino"
7+
]
8+
},
9+
{
10+
"name": "ArduinoBLE",
11+
"exclude_targets": [
12+
"esp32s2"
13+
],
14+
"sketch_path": [
15+
"~/Arduino/libraries/ArduinoBLE/examples/Central/Scan/Scan.ino"
16+
]
17+
},
18+
{
19+
"name": "ESP32Servo",
20+
"exclude_targets": [],
21+
"sketch_path": [
22+
"~/Arduino/libraries/ESP32Servo/examples/Knob/Knob.ino",
23+
"~/Arduino/libraries/ESP32Servo/examples/Sweep/Sweep.ino",
24+
"~/Arduino/libraries/ESP32Servo/examples/PWMExample/PWMExample.ino",
25+
"~/Arduino/libraries/ESP32Servo/examples/Multiple-Servo-Example-Arduino/Multiple-Servo-Example-Arduino.ino"
26+
]
27+
},
28+
{
29+
"source-url": "https://github.com/me-no-dev/ESPAsyncWebServer.git",
30+
"required-libs": [
31+
{"source-url": "https://github.com/me-no-dev/AsyncTCP.git"}
32+
],
33+
"exclude_targets": [],
34+
"sketch_path": [
35+
"~/Arduino/libraries/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino",
36+
"~/Arduino/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino",
37+
"~/Arduino/libraries/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino",
38+
"~/Arduino/libraries/ESPAsyncWebServer/examples/simple_server/simple_server.ino"
39+
]
40+
},
41+
{
42+
"name": "FastLED",
43+
"exclude_targets": [],
44+
"sketch_path": [
45+
"~/Arduino/libraries/FastLED/examples/Blink/Blink.ino"
46+
]
47+
},
48+
{
49+
"name": "IRremote",
50+
"exclude_targets": [],
51+
"sketch_path": [
52+
"~/Arduino/libraries/IRremote/examples/SendDemo/SendDemo.ino"
53+
]
54+
}
55+
]

Diff for: .github/workflows/lib.yml

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: External Libraries Test
2+
3+
# The workflow will run on schedule and labeled pull requests
4+
on:
5+
pull_request:
6+
types: [opened, reopened, synchronize, labeled]
7+
8+
# Schedule weekly builds on every Sunday at 4 am
9+
schedule:
10+
- cron: '0 4 * * SUN'
11+
12+
env:
13+
# It's convenient to set variables for values used multiple times in the workflow
14+
SKETCHES_REPORTS_PATH: libraries-report
15+
SKETCHES_REPORTS_ARTIFACT_NAME: libraries-report
16+
RESULT_LIBRARY_TEST_FILE: LIBRARIES_TEST.md
17+
JSON_LIBRARY_LIST_FILE: .github/workflows/lib.json
18+
jobs:
19+
compile-sketch:
20+
if: |
21+
contains(github.event.pull_request.labels.*.name, 'lib_test') ||
22+
(github.event_name == 'schedule' && github.repository == 'espressif/arduino-esp32')
23+
runs-on: ubuntu-latest
24+
25+
env:
26+
REPOSITORY: |
27+
- source-path: '.'
28+
name: "espressif:esp32"
29+
30+
strategy:
31+
matrix:
32+
target:
33+
- esp32
34+
- esp32s2
35+
- esp32c3
36+
- esp32s3
37+
38+
include:
39+
- target: esp32
40+
fqbn: espressif:esp32:esp32
41+
- target: esp32s2
42+
fqbn: espressif:esp32:esp32s2
43+
- target: esp32c3
44+
fqbn: espressif:esp32:esp32c3
45+
- target: esp32s3
46+
fqbn: espressif:esp32:esp32s3
47+
48+
49+
steps:
50+
# This step makes the contents of the repository available to the workflow
51+
- name: Checkout repository
52+
uses: actions/checkout@v3
53+
54+
- name: Compile sketch
55+
uses: P-R-O-C-H-Y/compile-sketches@main
56+
with:
57+
platforms: |
58+
${{ env.REPOSITORY }}
59+
target: ${{ matrix.target }}
60+
fqbn: ${{ matrix.fqbn }}
61+
use-json-file: true
62+
json-path: ${{ env.JSON_LIBRARY_LIST_FILE }}
63+
enable-deltas-report: true
64+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
65+
enable-warnings-report: true
66+
cli-compile-flags: |
67+
- --warnings="all"
68+
69+
- name: Upload artifact
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
73+
path: ${{ env.SKETCHES_REPORTS_PATH }}
74+
75+
report-to-file:
76+
needs: compile-sketch # Wait for the compile job to finish to get the data for the report
77+
if: github.event_name == 'schedule' # Only run the job when the workflow is triggered by a schedule
78+
runs-on: ubuntu-latest
79+
steps:
80+
# Check out repository
81+
- name: Checkout repository
82+
uses: actions/checkout@v3
83+
84+
# This step is needed to get the size data produced by the compile jobs
85+
- name: Download sketches reports artifact
86+
uses: actions/download-artifact@v3
87+
with:
88+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
89+
path: ${{ env.SKETCHES_REPORTS_PATH }}
90+
91+
- name: Report results
92+
uses: P-R-O-C-H-Y/report-size-deltas@main
93+
with:
94+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
95+
destination-file: ${{ env.RESULT_LIBRARY_TEST_FILE }}
96+
97+
- name: Append file with action URL
98+
uses: DamianReeves/write-file-action@master
99+
with:
100+
path: ${{ env.RESULT_LIBRARY_TEST_FILE }}
101+
contents: |
102+
/ [GitHub Action Link](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
103+
write-mode: append
104+
105+
- name: Push to github repo
106+
run: |
107+
git config user.name github-actions
108+
git config user.email github-actions@github.com
109+
git add ${{ env.RESULT_LIBRARY_TEST_FILE }}
110+
git commit -m "Generated External Libraries Test Results"
111+
git push
112+
113+
event_file:
114+
name: "Event File"
115+
if: |
116+
contains(github.event.pull_request.labels.*.name, 'lib_test')
117+
needs: compile-sketch
118+
runs-on: ubuntu-latest
119+
steps:
120+
- name: Upload
121+
uses: actions/upload-artifact@v2
122+
with:
123+
name: Event File
124+
path: ${{github.event_path}}

Diff for: .github/workflows/publishlib.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: External Libraries Results
2+
3+
on:
4+
workflow_run:
5+
workflows: [External Libraries Test]
6+
types:
7+
- completed
8+
9+
workflow_dispatch:
10+
env:
11+
# It's convenient to set variables for values used multiple times in the workflow
12+
SKETCHES_REPORTS_PATH: artifacts/libraries-report
13+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
14+
PR_EVENT_PATH: artifacts/Event File/event.json
15+
16+
jobs:
17+
lib-test-results:
18+
name: External Libraries Test Results
19+
runs-on: ubuntu-latest
20+
if: |
21+
github.event.workflow_run.event == 'pull_request' &&
22+
github.event.workflow_run.conclusion == 'success'
23+
24+
steps:
25+
- name: Download and Extract Artifacts
26+
run: |
27+
mkdir -p artifacts && cd artifacts
28+
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
29+
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
30+
do
31+
IFS=$'\t' read name url <<< "$artifact"
32+
gh api $url > "$name.zip"
33+
unzip -d "$name" "$name.zip"
34+
done
35+
36+
- name: Report results
37+
uses: P-R-O-C-H-Y/report-size-deltas@main
38+
with:
39+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
40+
github-token: ${{ env.GITHUB_TOKEN }}
41+
pr-event-path: ${{ env.PR_EVENT_PATH }}

Diff for: LIBRARIES_TEST.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Empty file

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Arduino core for the ESP32, ESP32-S2, ESP32-S3 and ESP32-C3
22

33
![Build Status](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![Documentation Status](https://readthedocs.com/projects/espressif-arduino-esp32/badge/?version=latest)](https://docs.espressif.com/projects/arduino-esp32/en/latest/?badge=latest)
4+
[![External Libraries Test](https://github.com/espressif/arduino-esp32/actions/workflows/lib.yml/badge.svg?branch=master&event=schedule)](https://github.com/espressif/arduino-esp32/actions/workflows/lib.yml?link=http://https://github.com/espressif/arduino-esp32/blob/master/LIBRARIES_TEST.md)
45

56
### Need help or have a question? Join the chat at [Gitter](https://gitter.im/espressif/arduino-esp32) or [open a new Discussion](https://github.com/espressif/arduino-esp32/discussions)
67

@@ -22,7 +23,7 @@ Latest Development Release [![Release Version](https://img.shields.io/github/re
2223

2324
### Development Planning
2425

25-
Our Development is fully tracked on this public **[Roadmap 🎉](https://github.com/orgs/espressif/projects/3)**
26+
Our Development is fully tracked on this public **[Roadmap 🎉](https://github.com/orgs/espressif/projects/3)**
2627

2728
For even more information you can take a look at [Sprint Meeting notes](https://github.com/espressif/arduino-esp32/discussions/categories/sprints-meeting-notes) or join [Monthly Community Meetings 🔔](https://github.com/espressif/arduino-esp32/discussions/categories/monthly-community-meetings)
2829

@@ -51,6 +52,11 @@ Before reporting an issue, make sure you've searched for similar one that was al
5152

5253
Finally, if you are sure no one else had the issue, follow the **Issue template** or **Feature request template** while reporting any [new Issue](https://github.com/espressif/arduino-esp32/issues/new/choose).
5354

55+
### External libraries compilation test
56+
57+
We have set-up CI testing for external libraries for ESP32 Arduino core. You can check test results in the file [LIBRARIES_TEST](https://github.com/espressif/arduino-esp32/blob/master/LIBRARIES_TEST.md).
58+
For more information and how to add your library to the test see [external library testing](https://docs.espressif.com/projects/arduino-esp32/en/latest/external_libraries_test.html) in the documentation.
59+
5460
### Contributing
5561

5662
We welcome contributions to the Arduino ESP32 project!

0 commit comments

Comments
 (0)