tinyusb/.github/workflows/test_hardware.yml

62 lines
2.0 KiB
YAML
Raw Normal View History

2022-07-23 18:39:22 +07:00
name: Hardware Test
on:
workflow_dispatch:
# Hardware in the loop (HIL)
# Current self-hosted instance is running on an RPI4 with
# - pico + pico-probe connected via USB
2022-07-26 22:55:47 +07:00
# - pico-probe is /dev/ttyACM0
2022-07-23 18:39:22 +07:00
jobs:
hw-test:
# Limit the run to only hathach due to limited resource on RPI4
#if: github.repository_owner == 'hathach' && ${{ github.event.workflow_run.conclusion == 'success' }}
if: github.repository_owner == 'hathach'
runs-on: [self-hosted, Linux, ARM64]
steps:
2022-07-27 16:08:08 +07:00
- name: Clean workspace
2022-07-23 18:39:22 +07:00
run: |
2022-07-26 16:49:51 +07:00
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
2022-07-27 16:08:08 +07:00
- name: Download rp2040 Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: build_arm.yml
name: rp2040
- name: Create flash.sh
#working-directory: ${{github.workspace}}
run: |
2022-07-27 15:44:21 +07:00
touch flash.sh
chmod +x flash.sh
2022-07-27 16:08:08 +07:00
echo > flash.sh 'openocd -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -c "program $1.elf reset exit"'
2022-07-28 13:31:42 +07:00
# echo >> flash.sh 'echo "Waiting for 0.5s for reset"'
# echo >> flash.sh 'sleep 0.5'
# echo >> flash.sh 'SECONDS=0'
# echo >> flash.sh 'lsusb | grep "cafe:"'
2022-07-27 15:44:21 +07:00
2022-07-26 22:55:47 +07:00
- name: Test cdc_dual_ports
2022-07-26 16:49:51 +07:00
run: |
2022-07-28 13:31:42 +07:00
echo "Second = $SECONDS"
2022-07-27 20:31:57 +07:00
./flash.sh cdc_dual_ports
2022-07-28 13:31:42 +07:00
echo "Second = $SECONDS"
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 5 ]; do :; done
2022-07-28 11:37:09 +07:00
echo $SECONDS
2022-07-27 15:03:55 +07:00
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
2022-07-26 22:55:47 +07:00
- name: Test cdc_msc
run: |
2022-07-28 13:31:42 +07:00
readme='/media/pi/TinyUSB MSC/README.TXT'
echo "Second = $SECONDS"
2022-07-27 15:44:21 +07:00
./flash.sh cdc_msc
2022-07-28 13:31:42 +07:00
echo "Second = $SECONDS"
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 5 ]; do :; done
echo "Second = $SECONDS"
2022-07-27 15:03:55 +07:00
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
2022-07-28 13:31:42 +07:00
test -f "$readme" && echo "$readme exists"
cat "$readme"