Skip to content

Commit

Permalink
update hil test to reuse action
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed May 10, 2024
1 parent 1f426dc commit fae8489
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 141 deletions.
52 changes: 32 additions & 20 deletions .github/workflows/hil_test.yml
Expand Up @@ -42,37 +42,44 @@ jobs:
with:
python-version: '3.x'

- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '12.3.Rel1'

- name: Parse HIL json
id: parse_hil_json
run: |
sudo apt install -y jq
# BOARD_LIST is all boards
BOARD_LIST=$(jq -r '.boards[] | "-b " + .name' test/hil/pi4.json | tr '\n' ' ')
echo "BOARD_LIST=$BOARD_LIST"
echo >> $GITHUB_ENV "BOARD_LIST=$BOARD_LIST"
echo >> $GITHUB_OUTPUT "BOARD_LIST=$BOARD_LIST"
echo "BOARD_LIST=$BOARD_LIST" >> $GITHUB_OUTPUT
- name: Checkout pico-sdk for rp2040
uses: actions/checkout@v4
# Espresif boards need to build with docker
BOARD_NON_ESP=$(jq -r '.boards[] | select(.flasher == "esptool") | "-b " + .name' test/hil/pi4.json | tr '\n' ' ')
BOARD_ESP=$(jq -r '.boards[] | select(.flasher == "esptool") | "-b " + .name' test/hil/pi4.json | tr '\n' ' ')
echo "BOARD_NON_ESP_LIST=$BOARD_NON_ESP_LIST" >> $GITHUB_ENV
echo "BOARD_ESP_LIST=$BOARD_ESP_LIST" >> $GITHUB_ENV
- name: Setup ARM Toolchain
uses: ./.github/actions/setup_toolchain
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk
toolchain: 'arm-gcc'

- name: Get Dependencies
run: |
sudo apt install -y ninja-build
python3 tools/get_deps.py $BOARD_LIST
uses: ./.github/actions/get_deps
with:
arg: env.BOARD_LIST

- name: Build
run: |
python tools/build.py $BOARD_LIST
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
run: python tools/build.py $BOARD_LIST

- name: Setup ESP-IDF
if: env.BOARD_ESP_LIST != ''
uses: ./.github/actions/setup_toolchain
with:
toolchain: 'esp-idf'
toolchain_url: 'v5.1.1'

- name: Build Espressif
if: env.BOARD_ESP_LIST != ''
run: docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python3 tools/build.py $BOARD_ESP

- name: Upload Artifacts for Hardware Testing
uses: actions/upload-artifact@v4
Expand All @@ -81,6 +88,11 @@ jobs:
path: |
cmake-build/cmake-build-*/*/*/*.elf
cmake-build/cmake-build-*/*/*/*.bin
# For Espressif
cmake-build/cmake-build-*/*/*/bootloader/bootloader.bin
cmake-build/cmake-build-*/*/*/partition_table/partition-table.bin
cmake-build/cmake-build-*/*/*/config.env
cmake-build/cmake-build-*/*/*/flash_args
# ---------------------------------------
# Hardware in the loop (HIL)
Expand All @@ -89,7 +101,7 @@ jobs:
hil-pi4:
if: github.repository_owner == 'hathach'
needs: build
runs-on: [self-hosted, rp2040, nrf52840, hardware-in-the-loop]
runs-on: [self-hosted, rp2040, nrf52840, esp32s3, hardware-in-the-loop]
env:
BOARD_LIST: ${{ needs.build.outputs.BOARD_LIST }}
steps:
Expand Down
10 changes: 10 additions & 0 deletions test/hil/pi4.json
Expand Up @@ -22,6 +22,16 @@
"flasher_product": "ItsyBitsy M4 Express",
"flasher_reset_pin": "2",
"flasher_args": "--offset 0x4000"
},
{
"name": "espressif_s3_devkitm",
"uid": "84F703C084E4",
"tests": [
"cdc_msc_freertos", "hid_composite_freertos"
],
"flasher": "esptool",
"flasher_sn": "3ea619acd1cdeb11a0a0b806e93fd3f1",
"flasher_args": "-b 1500000"
}
]
}
14 changes: 0 additions & 14 deletions test/hil/pi4_esp32.json

This file was deleted.

106 changes: 0 additions & 106 deletions tools/build_esp32.py

This file was deleted.

2 changes: 1 addition & 1 deletion tools/get_deps.py
Expand Up @@ -249,7 +249,7 @@ def main():

if len(families) == 0 and len(boards) == 0:
print("Please specify family or board to fetch")
return
return 1

status = 0
deps = list(deps_mandatory.keys())
Expand Down

0 comments on commit fae8489

Please sign in to comment.