6565 - ' xmc4000'
6666 steps :
6767 - name : Setup Python
68- uses : actions/setup-python@v3
68+ uses : actions/setup-python@v4
69+ with :
70+ python-version : ' 3.x'
6971
7072 - name : Install ARM GCC
7173 uses : carlosperate/arm-none-eabi-gcc-action@v1
@@ -99,11 +101,26 @@ jobs:
99101 - name : Linker Map
100102 run : |
101103 pip install linkermap/
102- for ex in `ls -d examples/device/*/`; do \
103- find ${ex} -name *.map -print -quit | \
104- xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
104+ # find -quit to only print linkermap of 1 board per example
105+ for ex in `ls -d examples/*/*/`
106+ do
107+ find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
105108 done
106109
110+ # Following steps are for Hardware Test with self-hosted
111+
112+ - name : Prepare Artifacts
113+ if : matrix.family == 'rp2040' && github.repository_owner == 'hathach'
114+ run : find examples/ -name "*.elf" -exec mv {} . \;
115+
116+ - name : Upload Artifacts for Hardware Test
117+ if : matrix.family == 'rp2040' && github.repository_owner == 'hathach'
118+ uses : actions/upload-artifact@v3
119+ with :
120+ name : ${{ matrix.family }}
121+ path : |
122+ *.elf
123+
107124 # ---------------------------------------
108125 # Build all no-family (orphaned) boards
109126 # ---------------------------------------
@@ -122,7 +139,9 @@ jobs:
122139
123140 steps :
124141 - name : Setup Python
125- uses : actions/setup-python@v3
142+ uses : actions/setup-python@v4
143+ with :
144+ python-version : ' 3.x'
126145
127146 - name : Install ARM GCC
128147 uses : carlosperate/arm-none-eabi-gcc-action@v1
@@ -137,3 +156,69 @@ jobs:
137156
138157 - name : Build
139158 run : python3 tools/build_board.py ${{ matrix.example }}
159+
160+ # ---------------------------------------
161+ # Hardware in the loop (HIL)
162+ # Current self-hosted instance is running on an RPI4 with
163+ # - pico + pico-probe connected via USB
164+ # - pico-probe is /dev/ttyACM0
165+ # ---------------------------------------
166+ hw-test :
167+ # Limit the run to only hathach due to limited resource on RPI4
168+ if : github.repository_owner == 'hathach'
169+ needs : build-arm
170+ runs-on : [self-hosted, Linux, ARM64]
171+
172+ steps :
173+ - name : Clean workspace
174+ run : |
175+ echo "Cleaning up previous run"
176+ rm -rf "${{ github.workspace }}"
177+ mkdir -p "${{ github.workspace }}"
178+
179+ - name : Download rp2040 Artifacts
180+ uses : actions/download-artifact@v3
181+ with :
182+ name : rp2040
183+
184+ - name : Create flash.sh
185+ run : |
186+ touch flash.sh
187+ chmod +x flash.sh
188+ echo > flash.sh 'openocd -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -c "program $1 reset exit"'
189+
190+ - name : Test cdc_dual_ports
191+ run : |
192+ ./flash.sh cdc_dual_ports.elf
193+ while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 5 ]; do :; done
194+ test -e /dev/ttyACM1 && echo "ttyACM1 exists"
195+ test -e /dev/ttyACM2 && echo "ttyACM2 exists"
196+
197+ - name : Test cdc_msc
198+ run : |
199+ ./flash.sh cdc_msc.elf
200+ readme='/media/pi/TinyUSB MSC/README.TXT'
201+ while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 5 ]; do :; done
202+ test -e /dev/ttyACM1 && echo "ttyACM1 exists"
203+ test -f "$readme" && echo "$readme exists"
204+ cat "$readme"
205+
206+ - name : Test dfu
207+ run : |
208+ ./flash.sh dfu.elf
209+ while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 5 ]; do :; done
210+ dfu-util -d cafe -a 0 -U dfu0
211+ dfu-util -d cafe -a 1 -U dfu1
212+ grep "TinyUSB DFU! - Partition 0" dfu0
213+ grep "TinyUSB DFU! - Partition 1" dfu1
214+
215+ - name : Test dfu_runtime
216+ run : |
217+ ./flash.sh dfu_runtime.elf
218+ while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done
219+
220+ # - name: Test hid_boot_interface
221+ # run: |
222+ # ./flash.sh hid_boot_interface.elf
223+ # while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done
224+
0 commit comments