diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 07ede52920..f197bffdbb 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -1,4 +1,4 @@ -name: Build CMake +name: Build on: workflow_dispatch: @@ -51,9 +51,9 @@ jobs: echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT # --------------------------------------- - # Build + # Build CMake # --------------------------------------- - build: + cmake: needs: set-matrix uses: ./.github/workflows/build_family.yml strategy: @@ -70,98 +70,5 @@ jobs: build-json: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain]) }} # --------------------------------------- - # Build ARM with GCC + # Build Make # --------------------------------------- - arm-gcc: - if: false - needs: set-matrix - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - family: ${{ fromJSON(needs.set-matrix.outputs.json).arm-gcc.family }} - steps: - - name: Checkout TinyUSB - uses: actions/checkout@v4 - - - name: Install ARM GCC - uses: carlosperate/arm-none-eabi-gcc-action@v1 - with: - release: '12.3.Rel1' - - - name: Prepare to build - uses: ./.github/actions/prepare_build - with: - family: ${{ matrix.family }} - - - name: Build - run: python tools/build_cmake.py ${{ matrix.family }} - - - name: Upload Artifacts for Hardware Testing (rp2040) - if: contains(matrix.family, 'rp2040') && github.repository_owner == 'hathach' - uses: actions/upload-artifact@v4 - with: - name: raspberry_pi_pico - path: | - cmake-build/cmake-build-raspberry_pi_pico/*/*/*.elf - - - name: Upload Artifacts for Hardware Testing (nRF) - if: contains(matrix.family, 'nrf') && github.repository_owner == 'hathach' - uses: actions/upload-artifact@v4 - with: - name: feather_nrf52840_express - path: | - cmake-build/cmake-build-feather_nrf52840_express/*/*/*.elf - - - name: Upload Artifacts for Hardware Testing (samd51) - if: contains(matrix.family, 'samd5x_e5x') && github.repository_owner == 'hathach' - uses: actions/upload-artifact@v4 - with: - name: itsybitsy_m4 - path: | - cmake-build/cmake-build-itsybitsy_m4/*/*/*.bin - - # --------------------------------------- - # Hardware in the loop (HIL) - # Current self-hosted instance is running on an RPI4. For attached hardware checkout hil_pi4.json - # --------------------------------------- - hil-test: - if: github.repository_owner == 'hathach' && false - needs: arm-gcc - runs-on: [self-hosted, rp2040, nrf52840, hardware-in-the-loop] - strategy: - fail-fast: false - matrix: - board: - - 'feather_nrf52840_express' - - 'itsybitsy_m4' - - 'raspberry_pi_pico' - steps: - - name: Clean workspace - run: | - echo "Cleaning up previous run" - 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 - lsusb -t - # reset VIA Labs 2.0 hub - sudo usbreset 001/002 - - - name: Checkout test/hil - uses: actions/checkout@v4 - with: - sparse-checkout: test/hil - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.board }} - path: cmake-build/cmake-build-${{ matrix.board }} - - - name: Test on actual hardware - run: | - python3 test/hil/hil_test.py --board ${{ matrix.board }} hil_pi4.json diff --git a/.github/workflows/build_iar.yml b/.github/workflows/build_iar.yml index c495fc079e..f7d26aee83 100644 --- a/.github/workflows/build_iar.yml +++ b/.github/workflows/build_iar.yml @@ -56,4 +56,4 @@ jobs: - name: Test on actual hardware (hardware in the loop) run: | - python3 test/hil/hil_test.py hil_hfp.json + python3 test/hil/hil_test.py hfp.json diff --git a/.github/workflows/hil_test.yml b/.github/workflows/hil_test.yml index 1dc7c50a28..f0bca39b86 100644 --- a/.github/workflows/hil_test.yml +++ b/.github/workflows/hil_test.yml @@ -51,7 +51,7 @@ jobs: id: parse_hil_json run: | sudo apt install -y jq - BOARD_LIST=$(jq -r '.boards[] | "-b " + .name' test/hil/hil_pi4.json | tr '\n' ' ') + BOARD_LIST=$(jq -r '.boards[] | "-b " + .name' test/hil/pi4.json | tr '\n' ' ') echo "BOARD_LIST=$BOARD_LIST" echo >> $GITHUB_ENV "BOARD_LIST=$BOARD_LIST" echo >> $GITHUB_OUTPUT "BOARD_LIST=$BOARD_LIST" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e36259daae..6b31517025 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -38,6 +38,7 @@ jobs: - name: Build Fuzzer run: | + pip install click export CC=clang export CXX=clang++ fuzz_harness=$(ls -d test/fuzz/device/*/) diff --git a/test/hil/hil_hfp.json b/test/hil/hfp.json similarity index 100% rename from test/hil/hil_hfp.json rename to test/hil/hfp.json diff --git a/tools/build_cmake.py b/tools/build_cmake.py index a5a6267bae..7283152db5 100644 --- a/tools/build_cmake.py +++ b/tools/build_cmake.py @@ -77,7 +77,7 @@ def build_family(family, toolchain): def main(family, board, toolchain): if len(family) == 0 and len(board) == 0: print("Please specify family or board to build") - return + return 1 print(build_separator) print(build_utils.build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM')) @@ -111,8 +111,8 @@ def main(family, board, toolchain): print(build_separator) print(f"Build Summary: {total_result[0]} {SUCCEEDED}, {total_result[1]} {FAILED} and took {total_time:.2f}s") print(build_separator) - sys.exit(total_result[1]) + return total_result[1] if __name__ == '__main__': - main() + sys.exit(main())