Skip to content

Commit c2c1a92

Browse files
committed
ci(performance): Add PSRAM speed test
1 parent bc25646 commit c2c1a92

File tree

9 files changed

+418
-16
lines changed

9 files changed

+418
-16
lines changed

.github/scripts/sketch_utils.sh

+12-11
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
135135

136136
sketchname=$(basename $sketchdir)
137137

138-
if [[ -n $target ]] && [[ -f "$sketchdir/.skip.$target" ]]; then
139-
echo "Skipping $sketchname for target $target"
140-
exit 0
141-
fi
142-
143138
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
144139
if [ -n "$ARDUINO_BUILD_DIR" ]; then
145140
build_dir="$ARDUINO_BUILD_DIR"
@@ -148,6 +143,12 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
148143
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
149144
fi
150145

146+
if [[ -n $target ]] && [[ -f "$sketchdir/.skip.$target" ]]; then
147+
echo "Skipping $sketchname for target $target"
148+
touch $build_dir/.skip.$target # Just to make sure the artifact is created for tests
149+
exit 0
150+
fi
151+
151152
output_file="$HOME/.arduino/cli_compile_output.txt"
152153
sizes_file="$GITHUB_WORKSPACE/cli_compile_$chunk_index.json"
153154

@@ -177,7 +178,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
177178
--build-path "$build_dir" \
178179
$xtra_opts "${sketchdir}" \
179180
> $output_file
180-
181+
181182
exit_status=$?
182183
if [ $exit_status -ne 0 ]; then
183184
echo ""ERROR: Compilation failed with error code $exit_status""
@@ -198,11 +199,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
198199
# Extract the desired substring using sed
199200
lib_sketch_name=$(echo "$directory_path" | sed "s|$constant_part||")
200201
#append json file where key is fqbn, sketch name, sizes -> extracted values
201-
echo "{\"name\": \"$lib_sketch_name\",
202+
echo "{\"name\": \"$lib_sketch_name\",
202203
\"sizes\": [{
203-
\"flash_bytes\": $flash_bytes,
204-
\"flash_percentage\": $flash_percentage,
205-
\"ram_bytes\": $ram_bytes,
204+
\"flash_bytes\": $flash_bytes,
205+
\"flash_percentage\": $flash_percentage,
206+
\"ram_bytes\": $ram_bytes,
206207
\"ram_percentage\": $ram_percentage
207208
}]
208209
}," >> "$sizes_file"
@@ -386,7 +387,7 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
386387
if [ $log_compilation ]; then
387388
#echo board,target and start of sketches to sizes_file json
388389
echo "{ \"board\": \"$fqbn\",
389-
\"target\": \"$target\",
390+
\"target\": \"$target\",
390391
\"sketches\": [" >> "$sizes_file"
391392
fi
392393

.github/scripts/tests_run.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ function run_test() {
88
local sketchdir=$(dirname $sketch)
99
local sketchname=$(basename $sketchdir)
1010

11+
if [[ -n $target ]] && [[ -f "$sketchdir/.skip.$target" ]]; then
12+
echo "Skipping $sketchname for target $target"
13+
exit 0
14+
fi
15+
1116
if [ $options -eq 0 ] && [ -f $sketchdir/cfg.json ]; then
1217
len=`jq -r --arg chip $target '.targets[] | select(.name==$chip) | .fqbn | length' $sketchdir/cfg.json`
1318
else
@@ -109,18 +114,18 @@ fi
109114
if [ $chunk_run -eq 0 ]; then
110115
if [ -z $sketch ]; then
111116
echo "ERROR: Sketch name is required for single test run"
112-
return 1
117+
exit 1
113118
fi
114119
run_test $target $test_folder/$sketch/$sketch.ino $options $erase
115120
else
116121
if [ "$chunk_max" -le 0 ]; then
117122
echo "ERROR: Chunks count must be positive number"
118-
return 1
123+
exit 1
119124
fi
120125

121126
if [ "$chunk_index" -ge "$chunk_max" ] && [ "$chunk_max" -ge 2 ]; then
122127
echo "ERROR: Chunk index must be less than chunks count"
123-
return 1
128+
exit 1
124129
fi
125130

126131
set +e
@@ -145,7 +150,7 @@ else
145150
start_index=$(( $chunk_index * $chunk_size ))
146151
if [ "$sketchcount" -le "$start_index" ]; then
147152
echo "Skipping job"
148-
return 0
153+
exit 0
149154
fi
150155

151156
end_index=$(( $(( $chunk_index + 1 )) * $chunk_size ))

.github/workflows/hil.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ jobs:
7777
with:
7878
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
7979
path: |
80+
~/.arduino/tests/**/build*.tmp/.skip.*
8081
~/.arduino/tests/**/build*.tmp/*.bin
8182
~/.arduino/tests/**/build*.tmp/*.json
82-
if-no-files-found: error
83+
8384
Test:
8485
needs: [gen_chunks, Build]
8586
name: ${{matrix.chip}}-Test#${{matrix.chunks}}

tests/performance/psramspeed/.skip.esp32c3

Whitespace-only changes.

tests/performance/psramspeed/.skip.esp32c6

Whitespace-only changes.

tests/performance/psramspeed/.skip.esp32h2

Whitespace-only changes.

tests/performance/psramspeed/cfg.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"targets": [
3+
{
4+
"name": "esp32",
5+
"fqbn":[
6+
"espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
7+
]
8+
},
9+
{
10+
"name": "esp32s2",
11+
"fqbn": [
12+
"espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
13+
]
14+
},
15+
{
16+
"name": "esp32s3",
17+
"fqbn": [
18+
"espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
19+
]
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)