Migrate hil vm (#2822)

* migrate hil to new x64 VM instead of rpi
* re-enable hil for s3
This commit is contained in:
Ha Thach
2024-09-30 10:58:19 +07:00
committed by GitHub
parent c8ab65fbb6
commit e209acb8d3
5 changed files with 76 additions and 71 deletions

View File

@@ -16,6 +16,10 @@ on:
required: false
default: false
type: boolean
upload-artifacts:
required: false
default: false
type: boolean
os:
required: false
type: string
@@ -62,3 +66,17 @@ jobs:
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
fi
shell: bash
- name: Upload Artifacts for Hardware Testing
if: ${{ inputs.upload-artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arg }}
path: |
cmake-build/cmake-build-*/*/*/*.elf
cmake-build/cmake-build-*/*/*/*.bin
cmake-build/cmake-build-*/*/*/*.bin
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

View File

@@ -18,7 +18,7 @@ concurrency:
cancel-in-progress: true
env:
HIL_JSON: test/hil/rpi.json
HIL_JSON: test/hil/tinyusb.json
jobs:
set-matrix:
@@ -32,7 +32,10 @@ jobs:
- name: Generate matrix json
id: set-matrix-json
run: |
MATRIX_JSON=$(jq -c '{ "arm-gcc": [.boards[] | select(.flasher != "esptool" and .flasher != "openocd_wch") | .name] }' ${{ env.HIL_JSON }})
MATRIX_ARMGCC=$(jq -c '{ "arm-gcc": { "family": [.boards[] | select(.flasher != "esptool" and .flasher != "openocd_wch") | "-b \(.name)"] } }' "${{ env.HIL_JSON }}")
MATRIX_ESP=$(jq -c '{ "esp-idf": { "family": [.boards[] | select(.flasher == "esptool") | "-b \(.name)"] } }' "${{ env.HIL_JSON }}")
MATRIX_RISCV=$(jq -c '{ "riscv-gcc": { "family": [.boards[] | select(.flasher == "openocd_wch") | "-b \(.name)"] } }' "${{ env.HIL_JSON }}")
MATRIX_JSON=$(jq -nc --argjson arm "$MATRIX_ARMGCC" --argjson esp "$MATRIX_ESP" --argjson riscv "$MATRIX_RISCV" '$arm + $esp + $riscv')
echo "matrix=$MATRIX_JSON"
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
@@ -42,44 +45,28 @@ jobs:
build:
if: github.repository_owner == 'hathach'
needs: set-matrix
runs-on: ubuntu-latest
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
matrix:
board: ${{ fromJSON(needs.set-matrix.outputs.json)['arm-gcc'] }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4
- name: Setup arm-gcc toolchain
uses: ./.github/actions/setup_toolchain
with:
toolchain: 'arm-gcc'
- name: Get Dependencies
uses: ./.github/actions/get_deps
with:
arg: -b${{ matrix.board }}
- name: Build
run: python tools/build.py -b${{ matrix.board }}
- name: Upload Artifacts for Hardware Testing
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.board }}
path: |
cmake-build/cmake-build-*/*/*/*.elf
cmake-build/cmake-build-*/*/*/*.bin
toolchain:
- 'arm-gcc'
- 'esp-idf'
with:
build-system: 'cmake'
toolchain: ${{ matrix.toolchain }}
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }}
one-per-family: true
upload-artifacts: true
# ---------------------------------------
# Hardware in the loop (HIL)
# self-hosted running on an RPI. For attached hardware checkout test/hil/rpi.json
# self-hosted running on an VM. For attached hardware checkout test/hil/tinyusb.json
# ---------------------------------------
hil-rpi:
hil-tinyusb:
if: github.repository_owner == 'hathach'
needs: build
runs-on: [self-hosted, ARM64, rpi, hardware-in-the-loop]
runs-on: [self-hosted, X64, hathach, hardware-in-the-loop]
steps:
- name: Clean workspace
run: |
@@ -87,13 +74,6 @@ jobs:
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
# USB bus on rpi is not stable, reset it before testing
# - name: Reset USB bus
# run: |
# echo "1-2" | sudo tee /sys/bus/usb/drivers/usb/unbind
# sleep 5
# echo "1-2" | sudo tee /sys/bus/usb/drivers/usb/bind
- name: Checkout TinyUSB
uses: actions/checkout@v4
with: