Skip to content

Commit

Permalink
Test2 using py_checkusb
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafFilies committed Oct 4, 2024
1 parent eabeefe commit 8806bbc
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/arduino_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,22 @@ jobs:
mfqbn=$(cat ./fqbn.yml | shyaml get-values fqbn | awk '{printf " --fqbn=%s", $0}')
echo "fqbn=$mfqbn" >> $GITHUB_OUTPUT
echo $GITHUB_ACTION
echo $fqbn
# Fetch the HIL information
cd /opt/runner_support/
python py_checkusb.py --switch repo --namelist $REPO --onoff on
declare -a typelist
declare -a seriallist
# Fetch the serial numbers for the HIL
mapfile -t typelist < <(python ./py_checkusb.py --repo ${REPO} --full --batch)
for TYPE in "${typelist[@]}";
do
declare -a serials
readarray -td, serials <<<"$TYPE"
echo ${serials[2]}
seriallist+=(${serials[2]})
done;
echo seriallist="$seriallist"
export mser=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${seriallist[@]}")
echo serials="$mser" >> $GITHUB_OUTPUT
Expand All @@ -111,6 +110,7 @@ jobs:
serials: ${{ steps.set-matrix.outputs.serials }}
repo: ${{ steps.set-matrix.outputs.repo }}
project: ${{ steps.set-matrix.outputs.project }}
#device: ${{ steps.set-matrix.outputs.device }}


#############################################################################
Expand Down Expand Up @@ -309,15 +309,37 @@ jobs:
- name: Flash
run: |
cd /opt/runner_support/
echo ${{ matrix.fqbn }}
declare -a devicelist
mapfile -t devicelist < <(python ./py_checkusb.py --serial ${{ matrix.fqbn }} --batch)
for line in "${devicelist[@]}";
do
readarray -td, device <<<"$line"
export SERIAL_NUM=${{ matrix.fqbn }}
export HEXNAME=${device[1]}
export DEVICE=${device[2]}
export PORT=`./find_usb.sh $SERIAL_NUM`
echo "Repo name extracted: " ${{ needs.setup.outputs.repo }}
echo "Real repo name: " ${{ needs.setup.outputs.project }}
echo "Build HEX name: " $HEXNAME
echo "Port Serial Num: " $SERIAL_NUM
echo "Flash device: " $DEVICE
echo "Port found: " $PORT
echo "Board type name: " $TYPE
cd $HOME
python $HOME/.arduino15/packages/Infineon/hardware/xmc/3.2.0/tools/xmc-flasher.py upload -d $DEVICE -p $PORT -f $HOME/Arduino/libraries/${{ needs.setup.outputs.project }}/${{ matrix.example }}/build/$HEXNAME/*.hex
done
# declare -a typelist
# declare -a seriallist
# export PATH=$PATH:/opt/runner_support/Unity
# mapfile -t typelist < <(python ./py_checkusb.py --repo ${{ needs.setup.outputs.repo }} --batch)
# for TYPE in "${typelist[@]}";
# do
Expand Down

0 comments on commit 8806bbc

Please sign in to comment.