Skip to content

Commit

Permalink
Merge branch 'ci/tests_refactor' into ci/refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed May 29, 2024
2 parents c74f66f + e842a54 commit d7f7df2
Show file tree
Hide file tree
Showing 24 changed files with 690 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/find_new_boards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ do
break
fi
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
if [ "$board_name" != "" ]
if [ "$board_name" != "" ] && [ "$board_name" != "esp32_family" ]
then
if [ "$board_name" != "$previous_board" ]
then
Expand Down
19 changes: 12 additions & 7 deletions .github/scripts/on-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function build(){
local chunk_index=$3
local chunks_cnt=$4
local build_log=$5
shift; shift; shift; shift; shift;
local sketches_file=$6
shift; shift; shift; shift; shift; shift;
local sketches=$*

local BUILD_SKETCH="${SCRIPTS_DIR}/sketch_utils.sh build"
Expand All @@ -23,6 +24,9 @@ function build(){
if [ "$OS_IS_LINUX" == "1" ]; then
args+=" -p $ARDUINO_ESP32_PATH/libraries"
args+=" -i $chunk_index -m $chunks_cnt"
if [ -n "$sketches_file" ]; then
args+=" -f $sketches_file"
fi
if [ $build_log -eq 1 ]; then
args+=" -l $build_log"
fi
Expand Down Expand Up @@ -50,6 +54,7 @@ fi
CHUNK_INDEX=$1
CHUNKS_CNT=$2
BUILD_LOG=$3
SKETCHES_FILE=$4
BUILD_PIO=0
if [ "$#" -lt 2 ] || [ "$CHUNKS_CNT" -le 0 ]; then
CHUNK_INDEX=0
Expand Down Expand Up @@ -94,12 +99,12 @@ if [ "$BUILD_PIO" -eq 0 ]; then
fi

#build sketches for different targets
build "esp32s3" $FQBN_ESP32S3 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
build "esp32s3" $FQBN_ESP32S3 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32s2" $FQBN_ESP32S2 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32c3" $FQBN_ESP32C3 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32c6" $FQBN_ESP32C6 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32h2" $FQBN_ESP32H2 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32" $FQBN_ESP32 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"

if [ "$BUILD_LOG" -eq 1 ]; then
#remove last comma from the last JSON object
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/on-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ RVTC_NEW_NAME="esp-rv32"
echo "Generating platform.txt..."
cat "$GITHUB_WORKSPACE/platform.txt" | \
sed "s/version=.*/version=$RELEASE_TAG/g" | \
sed 's/tools\.esp32-arduino-libs\.path\.windows=.*//g' | \
sed 's/{runtime\.platform\.path}.tools.esp32-arduino-libs/\{runtime.tools.esp32-arduino-libs.path\}/g' | \
sed 's/{runtime\.platform\.path}.tools.xtensa-esp-elf-gdb/\{runtime.tools.xtensa-esp-elf-gdb.path\}/g' | \
sed 's/{runtime\.platform\.path}.tools.xtensa-esp32-elf/\{runtime.tools.xtensa-esp32-elf-gcc.path\}/g' | \
Expand Down
27 changes: 21 additions & 6 deletions .github/scripts/sketch_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,22 +259,28 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
unset options
}

function count_sketches(){ # count_sketches <path> [target]
function count_sketches(){ # count_sketches <path> [target] [file]
local path=$1
local target=$2
local file=$3

if [ $# -lt 1 ]; then
echo "ERROR: Illegal number of parameters"
echo "USAGE: ${0} count <path> [target]"
fi

rm -rf sketches.txt
touch sketches.txt
if [ ! -d "$path" ]; then
touch sketches.txt
return 0
fi

local sketches=$(find $path -name *.ino | sort)
if [ -n "$file" ]; then
local sketches=$(cat $file)
else
local sketches=$(find $path -name *.ino | sort)
fi

local sketchnum=0
for sketch in $sketches; do
local sketchdir=$(dirname $sketch)
Expand Down Expand Up @@ -338,6 +344,10 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
shift
log_compilation=$1
;;
-f )
shift
sketches_file=$1
;;
* )
break
;;
Expand All @@ -347,7 +357,7 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat

local xtra_opts=$*

if [ -z $chunk_index ] || [ -z $chunk_max ]; then
if [ -z "$chunk_index" ] || [ -z "$chunk_max" ]; then
echo "ERROR: Invalid chunk paramters"
echo "$USAGE"
exit 1
Expand All @@ -363,8 +373,13 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
fi

set +e
count_sketches "$path" "$target"
local sketchcount=$?
if [ -n "$sketches_file" ]; then
count_sketches "$path" "$target" "$sketches_file"
local sketchcount=$?
else
count_sketches "$path" "$target"
local sketchcount=$?
fi
set -e
local sketches=$(cat sketches.txt)
rm -rf sketches.txt
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,13 @@
"sketch_path": [
"~/Arduino/libraries/WS2812FX/examples/ws2812fx_spi/ws2812fx_spi.ino"
]
},
{
"name": "ZACwire for TSic",
"exclude_targets": [],
"sketch_path": [
"~/Arduino/libraries/ZACwire_for_TSic/examples/ReadingTwoTSICs/ReadingTwoTSICs.ino",
"~/Arduino/libraries/ZACwire_for_TSic/examples/ReadSingleTSIC206/ReadSingleTSIC206.ino"
]
}
]
]
2 changes: 1 addition & 1 deletion .github/workflows/publishlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -j "$name.zip" -d "temp_$name"
if [[ "$name" == "pr_num" ]]; then
if [[ "$name" == "pr_number" ]]; then
mv "temp_$name"/* workflows
else
mv "temp_$name"/* libraries-report
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publishsizes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Sizes Results

on:
workflow_run:
workflows: [ESP32 Arduino CI]
workflows: [Compilation Tests]
types:
- completed

Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -j "$name.zip" -d "temp_$name"
if [[ "$name" == "pr_num" ]]; then
if [[ "$name" == "pr_number" ]]; then
mv "temp_$name"/* sizes-report
elif [[ "$name" == "pr_cli"* ]]; then
mv "temp_$name"/* sizes-report/pr
Expand All @@ -63,7 +63,7 @@ jobs:
uses: juliangruber/read-file-action@v1
with:
path: ./artifacts/sizes-report/pr_num.txt

- name: Report results
uses: P-R-O-C-H-Y/report-size-deltas@sizes_v2
with:
Expand Down
Loading

0 comments on commit d7f7df2

Please sign in to comment.