summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2024-09-08 17:15:28 +0200
committerGitHub <[email protected]>2024-09-08 17:15:28 +0200
commit7867464694a5889f5974385e962f40c9a064c7b2 (patch)
tree39e469aad8c7daa89c62e6a55a70dd1c0f32c8bb /.github/workflows
parent6d4e2f6c16e239889195fcfbd81b4d27b6ff1979 (diff)
parent3eea46056ea20aa12b73eea7c01d6c6e5b2d490a (diff)
Merge branch 'master' into dwc2_dma
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml40
-rw-r--r--.github/workflows/build_util.yml18
-rw-r--r--.github/workflows/ci_set_matrix.py33
-rw-r--r--.github/workflows/cifuzz.yml2
-rw-r--r--.github/workflows/hil_test.yml127
5 files changed, 74 insertions, 146 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 712c7dd43..6ca9885f8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -51,14 +51,13 @@ jobs:
# Build CMake
# ---------------------------------------
cmake:
- # if: false
needs: set-matrix
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
matrix:
toolchain:
- # - 'arm-clang' is built by circle-ci
+ # - 'arm-clang' is built by circle-ci in PR
- 'aarch64-gcc'
- 'arm-gcc'
- 'msp430-gcc'
@@ -66,38 +65,38 @@ jobs:
with:
build-system: 'cmake'
toolchain: ${{ matrix.toolchain }}
- toolchain_url: ${{ fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].toolchain_url }}
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }}
- one-per-family: ${{ github.event_name != 'pull_request' }}
+ one-per-family: ${{ github.event_name == 'push' }}
# ---------------------------------------
- # Build Make
+ # Build Make (built by circle-ci in PR, only build on push here)
# ---------------------------------------
make:
- # if: false
+ if: github.event_name == 'push'
needs: set-matrix
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
matrix:
toolchain:
- # 'arm-clang' is built by circle-ci
- - 'aarch64-gcc'
+ # 'arm-clang'
- 'arm-gcc'
+ - 'aarch64-gcc'
- 'msp430-gcc'
- 'riscv-gcc'
- 'rx-gcc'
+ - 'esp-idf' # buid-system is ignored
with:
build-system: 'make'
toolchain: ${{ matrix.toolchain }}
- toolchain_url: ${{ fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].toolchain_url }}
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }}
- one-per-family: ${{ github.event_name != 'pull_request' }}
+ one-per-family: true
# ---------------------------------------
# Build Make on Windows/MacOS
# ---------------------------------------
make-os:
+ if: github.event_name == 'pull_request'
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
@@ -111,30 +110,9 @@ jobs:
one-per-family: true
# ---------------------------------------
- # Build Espressif
- # ---------------------------------------
- espressif:
- # if: false
- uses: ./.github/workflows/build_util.yml
- strategy:
- fail-fast: false
- matrix:
- board:
- # ESP32-S2
- - 'espressif_kaluga_1'
- # ESP32-S3 skip since devkitm is also compiled in hil-test workflow
- #- 'espressif_s3_devkitm'
- with:
- build-system: 'cmake'
- toolchain: 'esp-idf'
- toolchain_url: 'v5.1.1'
- build-args: '["-b${{ matrix.board }}"]'
-
- # ---------------------------------------
# Build IAR on HFP self-hosted
# ---------------------------------------
arm-iar:
- # if: false
if: github.repository_owner == 'hathach'
needs: set-matrix
runs-on: [self-hosted, Linux, X64, hifiphile]
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
index 49a9feabd..ff98aef2d 100644
--- a/.github/workflows/build_util.yml
+++ b/.github/workflows/build_util.yml
@@ -9,9 +9,6 @@ on:
toolchain:
required: true
type: string
- toolchain_url:
- required: false
- type: string
build-args:
required: true
type: string
@@ -40,7 +37,7 @@ jobs:
uses: ./.github/actions/setup_toolchain
with:
toolchain: ${{ inputs.toolchain }}
- toolchain_url: ${{ inputs.toolchain_url }}
+ toolchain_version: 'v5.1.1'
- name: Get Dependencies
uses: ./.github/actions/get_deps
@@ -58,11 +55,10 @@ jobs:
shell: bash
- name: Build
- if: inputs.toolchain != 'esp-idf'
- run: |
- python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
-
- - name: Build using ESP-IDF docker
- if: inputs.toolchain == 'esp-idf'
run: |
- docker run --rm -v $PWD:/project -w /project espressif/idf:${{ inputs.toolchain_url }} python3 tools/build.py ${{ matrix.arg }}
+ 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 }}
+ 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
diff --git a/.github/workflows/ci_set_matrix.py b/.github/workflows/ci_set_matrix.py
index 5584b8312..4da26bfea 100644
--- a/.github/workflows/ci_set_matrix.py
+++ b/.github/workflows/ci_set_matrix.py
@@ -1,26 +1,29 @@
import json
# toolchain, url
-toolchain_list = {
- "aarch64-gcc": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz",
- "arm-clang": "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-17.0.1/LLVMEmbeddedToolchainForArm-17.0.1-Linux-x86_64.tar.xz",
- "arm-iar": "",
- "arm-gcc": "",
- "msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
- "riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
- "rx-gcc": "http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run",
-}
+toolchain_list = [
+ "aarch64-gcc",
+ "arm-clang",
+ "arm-iar",
+ "arm-gcc",
+ "esp-idf",
+ "msp430-gcc",
+ "riscv-gcc",
+ "rx-gcc"
+]
# family: [supported toolchain]
family_list = {
"broadcom_32bit": ["arm-gcc"],
"broadcom_64bit": ["aarch64-gcc"],
"ch32v10x ch32v20x ch32v307 fomu gd32vf103": ["riscv-gcc"],
+ "da1469x": ["arm-gcc"],
"imxrt": ["arm-gcc", "arm-clang"],
"kinetis_k kinetis_kl kinetis_k32l2": ["arm-gcc", "arm-clang"],
"lpc11 lpc13 lpc15": ["arm-gcc", "arm-clang"],
"lpc17 lpc18 lpc40 lpc43": ["arm-gcc", "arm-clang"],
"lpc51 lpc54 lpc55": ["arm-gcc", "arm-clang"],
+ "max32650 max32666 max32690 max78002": ["arm-gcc"],
"mcx": ["arm-gcc"],
"mm32": ["arm-gcc"],
"msp430": ["msp430-gcc"],
@@ -29,21 +32,25 @@ family_list = {
"ra": ["arm-gcc"],
"rp2040": ["arm-gcc"],
"rx": ["rx-gcc"],
- "samd11 samd21 saml2x": ["arm-gcc", "arm-clang"],
+ "samd11 saml2x": ["arm-gcc", "arm-clang"],
+ "samd21": ["arm-gcc", "arm-clang"],
"samd5x_e5x samg": ["arm-gcc", "arm-clang"],
"stm32f0 stm32f1 stm32f2 stm32f3": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32f4": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32f7": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32g0 stm32g4 stm32h5": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32h7": ["arm-gcc", "arm-clang", "arm-iar"],
- "stm32l4 stm32u5 stm32wb": ["arm-gcc", "arm-clang", "arm-iar"],
+ "stm32l0 stm32l4": ["arm-gcc", "arm-clang", "arm-iar"],
+ "stm32u5 stm32wb": ["arm-gcc", "arm-clang", "arm-iar"],
"xmc4000": ["arm-gcc"],
+ "-bespressif_kaluga_1": ["esp-idf"],
+ "-bespressif_s3_devkitm": ["esp-idf"],
}
def set_matrix_json():
matrix = {}
- for toolchain in toolchain_list.keys():
+ for toolchain in toolchain_list:
filtered_families = [family for family, supported_toolchain in family_list.items() if
toolchain in supported_toolchain]
@@ -54,7 +61,7 @@ def set_matrix_json():
hfp_boards = [f"-b{board['name']}" for board in hfp_data['boards']]
filtered_families = filtered_families + hfp_boards
- matrix[toolchain] = {"family": filtered_families, "toolchain_url": toolchain_list[toolchain]}
+ matrix[toolchain] = {"family": filtered_families}
print(json.dumps(matrix))
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
index 622d261a0..d7f1fc066 100644
--- a/.github/workflows/cifuzz.yml
+++ b/.github/workflows/cifuzz.yml
@@ -26,7 +26,7 @@ jobs:
with:
oss-fuzz-project-name: 'tinyusb'
language: c++
- fuzz-seconds: 600
+ fuzz-seconds: 400
- name: Upload Crash
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/hil_test.yml b/.github/workflows/hil_test.yml
index 39a9060a2..087374be2 100644
--- a/.github/workflows/hil_test.yml
+++ b/.github/workflows/hil_test.yml
@@ -17,111 +17,69 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+env:
+ HIL_JSON: test/hil/rpi.json
+
jobs:
- # ---------------------------------------
- # Build Non Espressif
- # ---------------------------------------
- build:
- if: github.repository_owner == 'hathach'
+ set-matrix:
runs-on: ubuntu-latest
outputs:
- BOARDS_LIST: ${{ steps.parse_hil_json.outputs.BOARDS_LIST }}
+ json: ${{ steps.set-matrix-json.outputs.matrix }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4
- - name: Parse HIL json
- id: parse_hil_json
+ - name: Generate matrix json
+ id: set-matrix-json
run: |
- sudo apt install -y jq
-
- # Non-Espresif boards
- BOARDS_LIST=$(jq -r '.boards[] | select(.flasher != "esptool") | "-b " + .name' test/hil/pi4.json | tr '\n' ' ')
- echo "BOARDS_LIST=$BOARDS_LIST"
- echo "BOARDS_LIST=$BOARDS_LIST" >> $GITHUB_ENV
- echo "BOARDS_LIST=$BOARDS_LIST" >> $GITHUB_OUTPUT
-
- - name: Setup Toolchain
- uses: ./.github/actions/setup_toolchain
- with:
- toolchain: 'arm-gcc'
-
- - name: Get Dependencies
- uses: ./.github/actions/get_deps
- with:
- arg: ${{ env.BOARDS_LIST }}
-
- - name: Build
- run: python tools/build.py $BOARDS_LIST
-
- - name: Upload Artifacts for Hardware Testing
- uses: actions/upload-artifact@v4
- with:
- name: hil_pi4
- path: |
- cmake-build/cmake-build-*/*/*/*.elf
- cmake-build/cmake-build-*/*/*/*.bin
+ MATRIX_JSON=$(jq -c '{ "arm-gcc": [.boards[] | select(.flasher != "esptool" and .flasher != "openocd_wch") | .name] }' ${{ env.HIL_JSON }})
+ echo "matrix=$MATRIX_JSON"
+ echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
# ---------------------------------------
- # Build Espressif
+ # Build arm-gcc
# ---------------------------------------
- build-esp:
+ build:
+ if: github.repository_owner == 'hathach'
+ needs: set-matrix
runs-on: ubuntu-latest
- outputs:
- BOARDS_LIST: ${{ steps.parse_hil_json.outputs.BOARDS_LIST }}
+ strategy:
+ fail-fast: false
+ matrix:
+ board: ${{ fromJSON(needs.set-matrix.outputs.json)['arm-gcc'] }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4
- - name: Parse HIL json
- id: parse_hil_json
- run: |
- sudo apt install -y jq
- # Espressif boards
- BOARDS_LIST=$(jq -r '.boards[] | select(.flasher == "esptool") | "-b " + .name' test/hil/pi4.json | tr '\n' ' ')
- echo "BOARDS_LIST=$BOARDS_LIST"
- echo "BOARDS_LIST=$BOARDS_LIST" >> $GITHUB_ENV
- echo "BOARDS_LIST=$BOARDS_LIST" >> $GITHUB_OUTPUT
-
- - name: Setup ESP-IDF
- if: env.BOARDS_LIST != ''
+ - name: Setup arm-gcc toolchain
uses: ./.github/actions/setup_toolchain
with:
- toolchain: 'esp-idf'
- toolchain_url: 'v5.1.1'
+ toolchain: 'arm-gcc'
- name: Get Dependencies
uses: ./.github/actions/get_deps
with:
- arg: ${{ env.BOARDS_LIST }}
+ arg: -b${{ matrix.board }}
- - name: Build Espressif
- if: env.BOARDS_LIST != ''
- run: docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python3 tools/build.py $BOARDS_LIST
+ - name: Build
+ run: python tools/build.py -b${{ matrix.board }}
- name: Upload Artifacts for Hardware Testing
uses: actions/upload-artifact@v4
with:
- name: hil_pi4_esp
+ name: ${{ matrix.board }}
path: |
+ cmake-build/cmake-build-*/*/*/*.elf
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
# ---------------------------------------
# Hardware in the loop (HIL)
- # Current self-hosted instance is running on an RPI4. For attached hardware checkout test/hil/pi4.json
+ # self-hosted running on an RPI. For attached hardware checkout test/hil/rpi.json
# ---------------------------------------
- hil-pi4:
+ hil-rpi:
if: github.repository_owner == 'hathach'
- needs:
- - build
- - build-esp
- runs-on: [self-hosted, rp2040, nrf52840, esp32s3, hardware-in-the-loop]
- env:
- BOARDS_LIST: "${{ needs.build.outputs.BOARDS_LIST }} ${{ needs.build-esp.outputs.BOARDS_LIST }}"
+ needs: build
+ runs-on: [self-hosted, ARM64, rpi, hardware-in-the-loop]
steps:
- name: Clean workspace
run: |
@@ -129,12 +87,12 @@ jobs:
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- # USB bus on rpi4 is not stable, reset it before testing
- - name: Reset USB bus
- run: |
- # lsusb -t
- # reset VIA Labs 2.0 hub
- sudo usbreset 001/002
+ # 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
@@ -144,19 +102,8 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
- name: hil_pi4
- path: cmake-build
-
- - name: Download Artifacts
- uses: actions/download-artifact@v4
- with:
- name: hil_pi4_esp
path: cmake-build
+ merge-multiple: true
- name: Test on actual hardware
- run: |
- echo "BOARDS_LIST=$BOARDS_LIST"
- echo "::group::{cmake-build contents}"
- tree cmake-build
- echo "::endgroup::"
- python3 test/hil/hil_test.py $BOARDS_LIST pi4.json
+ run: python3 test/hil/hil_test.py ${{ env.HIL_JSON }}