summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-10-02 18:22:06 +0700
committerhathach <[email protected]>2024-10-02 18:22:06 +0700
commitdb15f63736e44592e042a09b526c982e0bd80d4f (patch)
tree77d65e74899cf3481d2c37d52eb8331e9558e700 /.github/workflows
parent3fa7da95bd2a7189020ba6fe2d6aa17577f83abd (diff)
parenteda3cceab207bce390b995462e313ed124fa7732 (diff)
Merge branch 'master' into fork/Maerdl/master
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml2
-rw-r--r--.github/workflows/build_util.yml22
-rw-r--r--.github/workflows/ci_set_matrix.py1
-rw-r--r--.github/workflows/hil_test.yml56
4 files changed, 40 insertions, 41 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6ca9885f8..70bb3113f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -85,7 +85,7 @@ jobs:
- 'msp430-gcc'
- 'riscv-gcc'
- 'rx-gcc'
- - 'esp-idf' # buid-system is ignored
+ - 'esp-idf' # build-system is ignored
with:
build-system: 'make'
toolchain: ${{ matrix.toolchain }}
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
index ff98aef2d..706ded1c1 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
@@ -37,7 +41,7 @@ jobs:
uses: ./.github/actions/setup_toolchain
with:
toolchain: ${{ inputs.toolchain }}
- toolchain_version: 'v5.1.1'
+ toolchain_version: 'v5.3.1'
- name: Get Dependencies
uses: ./.github/actions/get_deps
@@ -57,8 +61,22 @@ jobs:
- name: Build
run: |
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
- docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python tools/build.py ${{ matrix.arg }}
+ docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py ${{ matrix.arg }}
else
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/ci_set_matrix.py b/.github/workflows/ci_set_matrix.py
index 4da26bfea..8974037e4 100644
--- a/.github/workflows/ci_set_matrix.py
+++ b/.github/workflows/ci_set_matrix.py
@@ -45,6 +45,7 @@ family_list = {
"xmc4000": ["arm-gcc"],
"-bespressif_kaluga_1": ["esp-idf"],
"-bespressif_s3_devkitm": ["esp-idf"],
+ "-bespressif_p4_function_ev": ["esp-idf"],
}
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: