summaryrefslogtreecommitdiff
path: root/.github/workflows/test_hardware.yml
blob: 68425a645f2ec1984b2004941850164633885a8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
# - pico-probe is /dev/ttyACM0

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:
    - name: Clean workspace
      run: |
        echo "Cleaning up previous run"
        rm -rf "${{ github.workspace }}"
        mkdir -p "${{ github.workspace }}"
        
    - name: Download rp2040 Artifacts
      uses: dawidd6/action-download-artifact@v2
      with:
        workflow: build_arm.yml
        name: rp2040
        
    - name: Test cdc_dual_ports
      env:
        example: cdc_dual_ports
      run: |
        openocd -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -c "program ${{ env.example }}.elf reset exit"
        echo "Waiting for enumeration (200 ms for reset, 5s for enumeration)"
        sleep 0.2
        SECONDS=0
        while (! lsusb | grep "cafe:") && [ $SECONDS -le 5 ] ; do : ; done
        # Test
        test -e /dev/ttyACM1 && echo "ttyACM1 exists"
        test -e /dev/ttyACM2 && echo "ttyACM2 exists"

    - name: Test cdc_msc
      env:
        example: cdc_msc
      run: |
        openocd -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -c "program ${{ env.example }}.elf reset exit"
        echo "Waiting for enumeration (200 ms for reset, 5s for enumeration)"
        sleep 0.2
        SECONDS=0
        while (! lsusb | grep "cafe:") && [ $SECONDS -le 5 ] ; do : ; done
        # Test
        test -e /dev/ttyACM1 && echo "ttyACM1 exists"
        test -f /media/pi/TinyUSB\ MSC/README.TXT && echo "MSC README.TXT exist"
        cat /media/pi/TinyUSB\ MSC/README.TXT