88 - ' examples/**'
99 - ' lib/**'
1010 - ' hw/**'
11+ - ' test/hil/**'
1112 - ' .github/workflows/build_esp.yml'
1213 pull_request :
1314 branches : [ master ]
1617 - ' examples/**'
1718 - ' lib/**'
1819 - ' hw/**'
20+ - ' test/hil/**'
1921 - ' .github/workflows/build_esp.yml'
2022
2123concurrency :
@@ -29,39 +31,78 @@ jobs:
2931 fail-fast : false
3032 matrix :
3133 board :
32- # Alphabetical order
3334 # ESP32-S2
34- - ' espressif_saola_1 '
35+ - ' espressif_kaluga_1 '
3536 # ESP32-S3
36- # - 'espressif_s3_devkitm'
37- # S3 compile error with "dangerous relocation: call8: call target out of range: memcpy"
38-
37+ - ' espressif_s3_devkitc'
3938 steps :
4039 - name : Setup Python
41- uses : actions/setup-python@v4
40+ uses : actions/setup-python@v5
4241 with :
4342 python-version : ' 3.x'
4443
4544 - name : Pull ESP-IDF docker
4645 run : docker pull espressif/idf:latest
4746
4847 - name : Checkout TinyUSB
49- uses : actions/checkout@v3
48+ uses : actions/checkout@v4
49+
50+ - name : Build
51+ run : docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python3 tools/build_esp32.py ${{ matrix.board }}
5052
51- - name : Checkout hathach/linkermap
52- uses : actions/checkout@v3
53+ - name : Upload Artifacts for Hardware Testing
54+ if : matrix.board == 'espressif_s3_devkitc' && github.repository_owner == 'hathach'
55+ uses : actions/upload-artifact@v3
5356 with :
54- repository : hathach/linkermap
55- path : linkermap
57+ name : ${{ matrix.board }}
58+ path : |
59+ cmake-build/cmake-build-${{ matrix.board }}/*/*/bootloader/bootloader.bin
60+ cmake-build/cmake-build-${{ matrix.board }}/*/*/*.bin
61+ cmake-build/cmake-build-${{ matrix.board }}/*/*/partition_table/partition-table.bin
62+ cmake-build/cmake-build-${{ matrix.board }}/*/*/config.env
63+ cmake-build/cmake-build-${{ matrix.board }}/*/*/flash_args
5664
57- - name : Build
58- run : docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32.py ${{ matrix.board }}
65+ # ---------------------------------------
66+ # Hardware in the loop (HIL)
67+ # Current self-hosted instance is running on an RPI4. For attached hardware checkout hil_pi4.json
68+ # ---------------------------------------
69+ hil-test :
70+ # run only with hathach's commit due to limited resource on RPI4
71+ if : github.repository_owner == 'hathach'
72+ needs : build-esp
73+ runs-on : [self-hosted, esp32s3, hardware-in-the-loop]
74+ strategy :
75+ fail-fast : false
76+ matrix :
77+ board :
78+ - ' espressif_s3_devkitc'
79+ steps :
80+ - name : Clean workspace
81+ run : |
82+ echo "Cleaning up previous run"
83+ rm -rf "${{ github.workspace }}"
84+ mkdir -p "${{ github.workspace }}"
85+
86+ # USB bus on rpi4 is not stable, reset it before testing
87+ - name : Reset USB bus
88+ run : |
89+ for port in $(lspci | grep USB | cut -d' ' -f1); do
90+ echo -n "0000:${port}"| sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind;
91+ sleep 0.1;
92+ echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind;
93+ done
94+
95+ - name : Checkout test/hil
96+ uses : actions/checkout@v4
97+ with :
98+ sparse-checkout : test/hil
99+
100+ - name : Download Artifacts
101+ uses : actions/download-artifact@v3
102+ with :
103+ name : ${{ matrix.board }}
104+ path : cmake-build/cmake-build-${{ matrix.board }}
59105
60- - name : Linker Map
61- run : |
62- pip install linkermap/
63- # find -quit to only print linkermap of 1 board per example
64- for ex in `ls -d examples/device/*/`
65- do
66- find ${ex} -maxdepth 3 -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
67- done
106+ - name : Test on actual hardware
107+ run : |
108+ python3 test/hil/hil_test.py --board ${{ matrix.board }} hil_pi4.json
0 commit comments