summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.yml9
-rw-r--r--.github/actions/setup_toolchain/action.yml17
-rw-r--r--.github/actions/setup_toolchain/download/action.yml16
-rw-r--r--.github/actions/setup_toolchain/espressif/action.yml9
-rw-r--r--.github/actions/setup_toolchain/toolchain.json9
-rw-r--r--.github/workflows/build.yml159
-rw-r--r--.github/workflows/build_util.yml5
-rwxr-xr-x.github/workflows/ci_set_matrix.py20
-rw-r--r--.github/workflows/codeql.yml8
-rw-r--r--.github/workflows/hil_test.yml88
-rw-r--r--.github/workflows/pre-commit.yml2
11 files changed, 194 insertions, 148 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index d00ee78bd..35576a439 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -24,8 +24,15 @@ body:
- type: input
attributes:
+ label: Commit SHA
+ placeholder: e.g 3a042b37da28d0ba1e5593eb1068ca5645d77b56 or version bundled by esp-idf or pico-sdk
+ validations:
+ required: true
+
+ - type: input
+ attributes:
label: Board
- placeholder: e.g Feather nRF52840 Express
+ placeholder: e.g Adafruit Feather nRF52840 Express
validations:
required: true
diff --git a/.github/actions/setup_toolchain/action.yml b/.github/actions/setup_toolchain/action.yml
index 8406a812d..6fd5c9d4e 100644
--- a/.github/actions/setup_toolchain/action.yml
+++ b/.github/actions/setup_toolchain/action.yml
@@ -4,9 +4,6 @@ inputs:
toolchain:
description: 'Toolchain name'
required: true
- toolchain_version:
- description: 'Toolchain version'
- required: false
outputs:
build_option:
@@ -20,30 +17,21 @@ runs:
if: inputs.toolchain == 'arm-gcc'
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
- release: '13.2.Rel1'
+ release: '14.2.Rel1'
- name: Pull ESP-IDF docker
if: inputs.toolchain == 'esp-idf'
uses: ./.github/actions/setup_toolchain/espressif
with:
toolchain: ${{ inputs.toolchain }}
- toolchain_version: ${{ inputs.toolchain_version }}
- name: Get Toolchain URL
if: >-
inputs.toolchain != 'arm-gcc' &&
- inputs.toolchain != 'arm-iar' &&
inputs.toolchain != 'esp-idf'
id: set-toolchain-url
run: |
- TOOLCHAIN_JSON='{
- "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-19.1.1/LLVM-ET-Arm-19.1.1-Linux-x86_64.tar.xz",
- "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_URL=$(echo $TOOLCHAIN_JSON | jq -r '.["${{ inputs.toolchain }}"]')
+ TOOLCHAIN_URL=$(jq -r '."${{ inputs.toolchain }}"' .github/actions/setup_toolchain/toolchain.json)
echo "toolchain_url=$TOOLCHAIN_URL"
echo "toolchain_url=$TOOLCHAIN_URL" >> $GITHUB_OUTPUT
shell: bash
@@ -51,7 +39,6 @@ runs:
- name: Download Toolchain
if: >-
inputs.toolchain != 'arm-gcc' &&
- inputs.toolchain != 'arm-iar' &&
inputs.toolchain != 'esp-idf'
uses: ./.github/actions/setup_toolchain/download
with:
diff --git a/.github/actions/setup_toolchain/download/action.yml b/.github/actions/setup_toolchain/download/action.yml
index 813197208..ce9643010 100644
--- a/.github/actions/setup_toolchain/download/action.yml
+++ b/.github/actions/setup_toolchain/download/action.yml
@@ -23,17 +23,25 @@ runs:
if: steps.cache-toolchain-download.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/${{ inputs.toolchain }}
- wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
+
if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
- mv toolchain.tar.gz toolchain.run
+ wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.run
chmod +x toolchain.run
./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
+ elif [[ ${{ inputs.toolchain }} == arm-iar ]]; then
+ wget --progress=dot:giga ${{ inputs.toolchain_url }} -O ~/cache/${{ inputs.toolchain }}/cxarm.deb
else
+ wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
fi
shell: bash
- - name: Set Toolchain Path
+ - name: Setup Toolchain
run: |
- echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
+ if [[ ${{ inputs.toolchain }} == arm-iar ]]; then
+ sudo apt-get install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
+ echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
+ else
+ echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
+ fi
shell: bash
diff --git a/.github/actions/setup_toolchain/espressif/action.yml b/.github/actions/setup_toolchain/espressif/action.yml
index 1e3ce18f1..b50ffd41d 100644
--- a/.github/actions/setup_toolchain/espressif/action.yml
+++ b/.github/actions/setup_toolchain/espressif/action.yml
@@ -6,7 +6,8 @@ inputs:
required: true
toolchain_version:
description: 'Toolchain version'
- required: true
+ required: false
+ default: 'v5.3.2'
runs:
using: "composite"
@@ -39,3 +40,9 @@ runs:
du -sh $DOCKER_ESP_IDF
docker load --input $DOCKER_ESP_IDF
shell: bash
+
+ - name: Tag Local Image
+ run: |
+ docker tag espressif/idf:${{ inputs.toolchain_version }} espressif/idf:tinyusb
+ docker images
+ shell: bash
diff --git a/.github/actions/setup_toolchain/toolchain.json b/.github/actions/setup_toolchain/toolchain.json
new file mode 100644
index 000000000..f7123ef11
--- /dev/null
+++ b/.github/actions/setup_toolchain/toolchain.json
@@ -0,0 +1,9 @@
+{
+ "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-19.1.1/LLVM-ET-Arm-19.1.1-Linux-x86_64.tar.xz",
+ "arm-gcc": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v14.2.1-1.1/xpack-arm-none-eabi-gcc-14.2.1-1.1-linux-x64.tar.gz",
+ "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": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",
+ "arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/583/cxarm-9.60.4.deb"
+}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 283b72061..5e11f8a29 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -8,8 +8,8 @@ on:
- 'examples/**'
- 'lib/**'
- 'hw/**'
- - 'tools/get_deps.py'
- 'tools/build.py'
+ - 'tools/get_deps.py'
- '.github/actions/**'
- '.github/workflows/build.yml'
- '.github/workflows/build_util.yml'
@@ -21,8 +21,9 @@ on:
- 'examples/**'
- 'lib/**'
- 'hw/**'
- - 'tools/get_deps.py'
+ - 'test/hil/**'
- 'tools/build.py'
+ - 'tools/get_deps.py'
- '.github/actions/**'
- '.github/workflows/build.yml'
- '.github/workflows/build_util.yml'
@@ -31,11 +32,15 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+env:
+ HIL_JSON: test/hil/tinyusb.json
+
jobs:
set-matrix:
runs-on: ubuntu-latest
outputs:
json: ${{ steps.set-matrix-json.outputs.matrix }}
+ hil_json: ${{ steps.set-matrix-json.outputs.hil_matrix }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4
@@ -43,33 +48,41 @@ jobs:
- name: Generate matrix json
id: set-matrix-json
run: |
+ # build matrix
MATRIX_JSON=$(python .github/workflows/ci_set_matrix.py)
echo "matrix=$MATRIX_JSON"
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
+ # hil matrix
+ HIL_MATRIX_JSON=$(python test/hil/hil_ci_set_matrix.py ${{ env.HIL_JSON }})
+ echo "hil_matrix=$HIL_MATRIX_JSON"
+ echo "hil_matrix=$HIL_MATRIX_JSON" >> $GITHUB_OUTPUT
# ---------------------------------------
- # Build CMake
+ # Build CMake: only build on push with one-per-family.
+ # Full built is done by CircleCI in PR
# ---------------------------------------
cmake:
+ 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 in PR
- 'aarch64-gcc'
+ #- 'arm-clang'
- 'arm-gcc'
+ - 'esp-idf'
- 'msp430-gcc'
- 'riscv-gcc'
with:
build-system: 'cmake'
toolchain: ${{ matrix.toolchain }}
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain]) }}
- one-per-family: ${{ github.event_name == 'push' }}
+ one-per-family: true
# ---------------------------------------
- # Build Make (built by circle-ci in PR, only build on push here)
+ # Build Make: only build on push with one-per-family
# ---------------------------------------
make:
if: github.event_name == 'push'
@@ -79,13 +92,12 @@ jobs:
fail-fast: false
matrix:
toolchain:
- # 'arm-clang'
- - 'arm-gcc'
- 'aarch64-gcc'
+ #- 'arm-clang'
+ - 'arm-gcc'
- 'msp430-gcc'
- 'riscv-gcc'
- 'rx-gcc'
- - 'esp-idf' # build-system is ignored
with:
build-system: 'make'
toolchain: ${{ matrix.toolchain }}
@@ -93,6 +105,28 @@ jobs:
one-per-family: true
# ---------------------------------------
+ # Build IAR
+ # Since IAR Token secret is not passed to forked PR, only build non-forked PR with make.
+ # cmake is built by circle-ci. Due to IAR limit capacity, only build oe per family
+ # ---------------------------------------
+ arm-iar:
+ if: false # disable for now since we got reach capacity limit too often
+ #if: github.event_name == 'push' && github.repository_owner == 'hathach'
+ needs: set-matrix
+ uses: ./.github/workflows/build_util.yml
+ secrets: inherit
+ strategy:
+ fail-fast: false
+ matrix:
+ build-system:
+ - 'make'
+ with:
+ build-system: ${{ matrix.build-system }}
+ toolchain: 'arm-iar'
+ build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)['arm-iar']) }}
+ one-per-family: true
+
+ # ---------------------------------------
# Build Make on Windows/MacOS
# ---------------------------------------
make-os:
@@ -110,36 +144,121 @@ jobs:
one-per-family: true
# ---------------------------------------
- # Build IAR on HFP self-hosted
+ # Zephyr
# ---------------------------------------
- arm-iar:
- if: github.repository_owner == 'hathach'
+ zephyr:
+ if: github.event_name == 'push'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout TinyUSB
+ uses: actions/checkout@v4
+
+ - name: Setup Zephyr project
+ uses: zephyrproject-rtos/action-zephyr-setup@v1
+ with:
+ app-path: examples
+ toolchains: arm-zephyr-eabi
+
+ - name: Build
+ run: |
+ west build -b pca10056 -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
+ west build -b pca10056 -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr
+
+ # ---------------------------------------
+ # Hardware in the loop (HIL)
+ # Run on PR only (hil-tinyusb), hil-hfp only run on non-forked PR
+ # ---------------------------------------
+ hil-build:
+ if: |
+ github.repository_owner == 'hathach' &&
+ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
needs: set-matrix
+ uses: ./.github/workflows/build_util.yml
+ strategy:
+ fail-fast: false
+ matrix:
+ toolchain:
+ - 'arm-gcc'
+ - 'esp-idf'
+ with:
+ build-system: 'cmake'
+ toolchain: ${{ matrix.toolchain }}
+ build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.hil_json)[matrix.toolchain]) }}
+ one-per-family: true
+ upload-artifacts: true
+
+ # ---------------------------------------
+ # Hardware in the loop (HIL)
+ # self-hosted on local VM, for attached hardware checkout HIL_JSON
+ # ---------------------------------------
+ hil-tinyusb:
+ if: |
+ github.repository_owner == 'hathach' &&
+ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
+ needs: hil-build
+ runs-on: [self-hosted, X64, hathach, hardware-in-the-loop]
+ steps:
+ - name: Clean workspace
+ run: |
+ echo "Cleaning up previous run"
+ rm -rf "${{ github.workspace }}"
+ mkdir -p "${{ github.workspace }}"
+
+ - name: Checkout TinyUSB
+ uses: actions/checkout@v4
+ with:
+ sparse-checkout: test/hil
+
+ - name: Download Artifacts
+ uses: actions/download-artifact@v4
+ with:
+ path: cmake-build
+ merge-multiple: true
+
+ - name: Test on actual hardware
+ run: |
+ ls cmake-build/
+ python3 test/hil/hil_test.py ${{ env.HIL_JSON }}
+
+ # ---------------------------------------
+ # Hardware in the loop (HIL)
+ # self-hosted by HFP, build with IAR toolchain, for attached hardware checkout test/hil/hfp.json
+ # Since IAR Token secret is not passed to forked PR, only build non-forked PR
+ # ---------------------------------------
+ hil-hfp:
+ if: |
+ github.repository_owner == 'hathach' &&
+ github.event.pull_request.head.repo.fork == false &&
+ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
runs-on: [self-hosted, Linux, X64, hifiphile]
env:
- BUILD_ARGS: ${{ join(fromJSON(needs.set-matrix.outputs.json)['arm-iar'], ' ') }}
- IAR_LMS_CLOUD_URL: https://license.cloud.iar.com
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
- rm -rf "${{ github.workspace }}"
+ rm -rf "${{ github.workspace }}"3
mkdir -p "${{ github.workspace }}"
- name: Toolchain version
- run: iccarm --version
+ run: |
+ iccarm --version
- name: Checkout TinyUSB
uses: actions/checkout@v4
+ - name: Get build boards
+ run: |
+ MATRIX_JSON=$(python test/hil/hil_ci_set_matrix.py test/hil/hfp.json)
+ BUILD_ARGS=$(echo $MATRIX_JSON | jq -r '.["arm-gcc"] | join(" ")')
+ echo "BUILD_ARGS=$BUILD_ARGS"
+ echo "BUILD_ARGS=$BUILD_ARGS" >> $GITHUB_ENV
+
- name: Get Dependencies
run: python3 tools/get_deps.py $BUILD_ARGS
- name: Build
- run: python3 tools/build.py --one-per-family --toolchain iar $BUILD_ARGS
+ run: python3 tools/build.py -j 4 --toolchain iar $BUILD_ARGS
- name: Test on actual hardware (hardware in the loop)
- if: github.event_name == 'pull_request'
- run: |
- python3 test/hil/hil_test.py hfp.json
+ run: python3 test/hil/hil_test.py hfp.json
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
index 706ded1c1..a2c96f3c0 100644
--- a/.github/workflows/build_util.yml
+++ b/.github/workflows/build_util.yml
@@ -41,7 +41,6 @@ jobs:
uses: ./.github/actions/setup_toolchain
with:
toolchain: ${{ inputs.toolchain }}
- toolchain_version: 'v5.3.1'
- name: Get Dependencies
uses: ./.github/actions/get_deps
@@ -59,9 +58,11 @@ jobs:
shell: bash
- name: Build
+ env:
+ IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
run: |
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
- docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py ${{ matrix.arg }}
+ docker run --rm -v $PWD:/project -w /project espressif/idf:tinyusb 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
diff --git a/.github/workflows/ci_set_matrix.py b/.github/workflows/ci_set_matrix.py
index 78fcac68a..ddb3ee1fb 100755
--- a/.github/workflows/ci_set_matrix.py
+++ b/.github/workflows/ci_set_matrix.py
@@ -24,7 +24,7 @@ family_list = {
"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"],
+ "maxim": ["arm-gcc"],
"mcx": ["arm-gcc"],
"mm32": ["arm-gcc"],
"msp430": ["msp430-gcc"],
@@ -40,13 +40,15 @@ family_list = {
"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"],
+ "stm32h7 stm32h7rs": ["arm-gcc", "arm-clang", "arm-iar"],
"stm32l0 stm32l4": ["arm-gcc", "arm-clang", "arm-iar"],
+ "stm32n6": ["arm-gcc"],
"stm32u5 stm32wb": ["arm-gcc", "arm-clang", "arm-iar"],
"xmc4000": ["arm-gcc"],
- "-bespressif_kaluga_1": ["esp-idf"],
- "-bespressif_s3_devkitm": ["esp-idf"],
- "-bespressif_p4_function_ev": ["esp-idf"],
+ "-bespressif_s2_devkitc": ["esp-idf"],
+ # S3, P4 will be built by hil test
+ # "-bespressif_s3_devkitm": ["esp-idf"],
+ # "-bespressif_p4_function_ev": ["esp-idf"],
}
@@ -55,14 +57,6 @@ def set_matrix_json():
for toolchain in toolchain_list:
filtered_families = [family for family, supported_toolchain in family_list.items() if
toolchain in supported_toolchain]
-
- # always add board in hfp.json for arm-iar
- if toolchain == 'arm-iar':
- with open('test/hil/hfp.json') as f:
- hfp_data = json.load(f)
- hfp_boards = [f"-b{board['name']}" for board in hfp_data['boards']]
- filtered_families = filtered_families + hfp_boards
-
matrix[toolchain] = filtered_families
print(json.dumps(matrix))
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index be4c2dd87..dfcca6315 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -66,7 +66,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -93,7 +93,7 @@ jobs:
./.github/workflows/codeql-buildscript.sh
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
upload: false
@@ -124,12 +124,12 @@ jobs:
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
- name: Upload SARIF
- uses: github/codeql-action/upload-sarif@v2
+ uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.step1.outputs.sarif-output }}
category: "/language:${{matrix.language}}"
- - name: Archive CodeQL results
+ - name: Upload CodeQL results as an artifact
uses: actions/upload-artifact@v4
with:
name: codeql-results
diff --git a/.github/workflows/hil_test.yml b/.github/workflows/hil_test.yml
deleted file mode 100644
index c6e7f33b0..000000000
--- a/.github/workflows/hil_test.yml
+++ /dev/null
@@ -1,88 +0,0 @@
-name: Hardware Test
-
-on:
- workflow_dispatch:
- pull_request:
- branches: [ master ]
- paths:
- - 'src/**'
- - 'examples/**'
- - 'lib/**'
- - 'hw/**'
- - 'test/hil/**'
- - 'tools/get_deps.py'
- - '.github/actions/**'
- - '.github/workflows/hil_test.yml'
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-env:
- HIL_JSON: test/hil/tinyusb.json
-
-jobs:
- set-matrix:
- runs-on: ubuntu-latest
- outputs:
- json: ${{ steps.set-matrix-json.outputs.matrix }}
- steps:
- - name: Checkout TinyUSB
- uses: actions/checkout@v4
-
- - name: Generate matrix json
- id: set-matrix-json
- run: |
- MATRIX_JSON=$(python test/hil/hil_ci_set_matrix.py ${{ env.HIL_JSON }})
- echo "matrix=$MATRIX_JSON"
- echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
-
- # ---------------------------------------
- # Build arm-gcc
- # ---------------------------------------
- build:
- if: github.repository_owner == 'hathach'
- needs: set-matrix
- uses: ./.github/workflows/build_util.yml
- strategy:
- fail-fast: false
- matrix:
- toolchain:
- - 'arm-gcc'
- - 'esp-idf'
- with:
- build-system: 'cmake'
- toolchain: ${{ matrix.toolchain }}
- build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain]) }}
- one-per-family: true
- upload-artifacts: true
-
- # ---------------------------------------
- # Hardware in the loop (HIL)
- # self-hosted running on an VM. For attached hardware checkout HIL_JSON
- # ---------------------------------------
- hil-tinyusb:
- if: github.repository_owner == 'hathach'
- needs: build
- runs-on: [self-hosted, X64, hathach, hardware-in-the-loop]
- steps:
- - name: Clean workspace
- run: |
- echo "Cleaning up previous run"
- rm -rf "${{ github.workspace }}"
- mkdir -p "${{ github.workspace }}"
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v4
- with:
- sparse-checkout: test/hil
-
- - name: Download Artifacts
- uses: actions/download-artifact@v4
- with:
- path: cmake-build
- merge-multiple: true
-
- - name: Test on actual hardware
- run: |
- ls cmake-build/
- python3 test/hil/hil_test.py ${{ env.HIL_JSON }}
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index 530484079..ed0efd66e 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -33,6 +33,8 @@ jobs:
- name: Build Fuzzer
run: |
+ sudo apt install libc++-dev libc++abi-dev
+ clang --version
export CC=clang
export CXX=clang++
fuzz_harness=$(ls -d test/fuzz/device/*/)