summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-09-30 10:58:19 +0700
committerGitHub <[email protected]>2024-09-30 10:58:19 +0700
commite209acb8d3624d3e6e6b6cee827bf4a97a4b138c (patch)
tree6a13b1b8ae1e0626008d42631258dbd87208152e /.github/workflows
parentc8ab65fbb6ed24b470df8c3b2f35c27ce0d54053 (diff)
Migrate hil vm (#2822)
* migrate hil to new x64 VM instead of rpi * re-enable hil for s3
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build_util.yml18
-rw-r--r--.github/workflows/hil_test.yml56
2 files changed, 36 insertions, 38 deletions
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
index ff98aef2d..294d18140 100644
--- a/.github/workflows/build_util.yml
+++ b/.github/workflows/build_util.yml
@@ -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
diff --git a/.github/workflows/hil_test.yml b/.github/workflows/hil_test.yml
index 087374be2..6ece44922 100644
--- a/.github/workflows/hil_test.yml
+++ b/.github/workflows/hil_test.yml
@@ -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: