Skip to content
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

CI HW Testing Update #7911

Merged
merged 16 commits into from
Apr 6, 2023
Merged
8 changes: 5 additions & 3 deletions .github/scripts/sketch_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,26 +117,27 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
# 3. Created at the sketch level as "buildX" where X is the number
# of configuration built in case of a multiconfiguration test.

sketchname=$(basename $sketchdir)

ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
if [ -n "$ARDUINO_BUILD_DIR" ]; then
build_dir="$ARDUINO_BUILD_DIR"
elif [ $len -eq 1 ]; then
# build_dir="$sketchdir/build"
build_dir="$HOME/.arduino/build.tmp"
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
fi

mkdir -p "$ARDUINO_CACHE_DIR"
for i in `seq 0 $(($len - 1))`
do
if [ $len -ne 1 ]; then
# build_dir="$sketchdir/build$i"
build_dir="$HOME/.arduino/build$i.tmp"
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
fi
rm -rf $build_dir
mkdir -p $build_dir

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

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

$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
-fqbn=\"$currfqbn\" \
Expand Down
6 changes: 4 additions & 2 deletions .github/scripts/tests_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ function run_test() {
fi

if [ $len -eq 1 ]; then
build_dir="tests/$sketchname/build"
# build_dir="tests/$sketchname/build"
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
report_file="tests/$sketchname/$sketchname.xml"
fi

Expand All @@ -27,7 +28,8 @@ function run_test() {
fi

if [ $len -ne 1 ]; then
build_dir="tests/$sketchname/build$i"
# build_dir="tests/$sketchname/build$i"
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
report_file="tests/$sketchname/$sketchname$i.xml"
fi

Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/hil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
set -e
rm sketches.txt
CHUNKS=$(jq -c -n '$ARGS.positional' --args `seq 0 1 $((sketches - 1))`)
echo "::set-output name=chunks::${CHUNKS}"
echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT

Build:
needs: gen_chunks
Expand All @@ -49,21 +49,20 @@ jobs:
matrix:
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}}

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Build sketches
run: |
bash .github/scripts/tests_build.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}}
- name: Upload ${{matrix.chip}}-${{matrix.chunks}} artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
path: |
tests/*/build*/*.bin
tests/*/build*/*.json
~/.arduino/tests/*/build*.tmp/*.bin
~/.arduino/tests/*/build*.tmp/*.json
if-no-files-found: error
Test:
needs: [gen_chunks, Build]
name: ${{matrix.chip}}-Test#${{matrix.chunks}}
Expand All @@ -87,10 +86,10 @@ jobs:
uses: actions/checkout@v3

- name: Download ${{matrix.chip}}-${{matrix.chunks}} artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
path: tests/
path: ~/.arduino/tests/

- name: Install dependencies
run: |
Expand All @@ -103,7 +102,7 @@ jobs:
bash .github/scripts/tests_run.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}} -e

- name: Upload test result artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: test_results-${{matrix.chip}}-${{matrix.chunks}}
Expand All @@ -118,7 +117,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{github.event_path}}
2 changes: 1 addition & 1 deletion tests/touch/touch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ uint8_t TOUCH_GPIOS[] = {1,2,3,4,5,6,7,8,9,10,11,12/*,13,14*/};
#define INTERRUPT_THRESHOLD 30000
#elif CONFIG_IDF_TARGET_ESP32S3
#define RELEASED_VALUE 25000 //25000- read value to pass test
#define PRESSED_VALUE 100000 //150000+ read value to pass test
#define PRESSED_VALUE 90000 //90000+ read value to pass test
#define INTERRUPT_THRESHOLD 80000
#else
#error Test not currently supported on this chip. Please adjust and try again!
Expand Down