diff options
| author | Mengsk <[email protected]> | 2022-12-29 12:14:52 +0100 |
|---|---|---|
| committer | Mengsk <[email protected]> | 2022-12-29 12:14:52 +0100 |
| commit | 8327090171246d0928195c49f4f15ce8b569a39b (patch) | |
| tree | 40b3f6d218e06bff8ec485ec1b8bfa897ce8467c /.github/workflows | |
| parent | d584b07e2c8068a51c89421be2ddc116f4fc9d3e (diff) | |
| parent | 549bee94add9d8f1c346bfa0fa6b25481db3f191 (diff) | |
Merge branch 'master' of https://github.com/hathach/tinyusb into stm32_fsdev
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build_aarch64.yml | 22 | ||||
| -rw-r--r-- | .github/workflows/build_arm.yml | 51 | ||||
| -rw-r--r-- | .github/workflows/build_esp.yml | 20 | ||||
| -rw-r--r-- | .github/workflows/build_msp430.yml | 25 | ||||
| -rw-r--r-- | .github/workflows/build_renesas.yml | 22 | ||||
| -rw-r--r-- | .github/workflows/build_riscv.yml | 22 | ||||
| -rw-r--r-- | .github/workflows/pre-commit.yml | 46 | ||||
| -rw-r--r-- | .github/workflows/test_hardware.yml | 94 |
8 files changed, 249 insertions, 53 deletions
diff --git a/.github/workflows/build_aarch64.yml b/.github/workflows/build_aarch64.yml index 18989a5e9..c552a9574 100644 --- a/.github/workflows/build_aarch64.yml +++ b/.github/workflows/build_aarch64.yml @@ -1,11 +1,23 @@ name: Build AArch64 on: - pull_request: push: - release: - types: - - created + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + pull_request: + branches: [ master ] + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: # --------------------------------------- @@ -41,7 +53,7 @@ jobs: run: echo >> $GITHUB_ENV TOOLCHAIN_URL=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 - name: Cache Toolchain - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-toolchain with: path: ~/cache/ diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml index 53f73a48f..c16fc0d45 100644 --- a/.github/workflows/build_arm.yml +++ b/.github/workflows/build_arm.yml @@ -1,34 +1,25 @@ name: Build ARM on: - pull_request: push: - release: - types: - - created - -jobs: - # --------------------------------------- - # Unit testing with Ceedling - # --------------------------------------- - unit-test: - runs-on: ubuntu-latest - steps: - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - - - name: Checkout TinyUSB - uses: actions/checkout@v3 + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + pull_request: + branches: [ master ] + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' - - name: Unit Tests - run: | - # Install Ceedling - gem install ceedling - cd test - ceedling test:all +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true +jobs: # --------------------------------------- # Build ARM family # --------------------------------------- @@ -123,9 +114,11 @@ jobs: # --------------------------------------- # Build all no-family (orphaned) boards + # disable this workflow since it is often failed randomly # --------------------------------------- build-board: runs-on: ubuntu-latest + if: false strategy: fail-fast: false matrix: @@ -163,11 +156,11 @@ jobs: # - pico + pico-probe connected via USB # - pico-probe is /dev/ttyACM0 # --------------------------------------- - hw-test: + hw-rp2040-test: # Limit the run to only hathach due to limited resource on RPI4 if: github.repository_owner == 'hathach' needs: build-arm - runs-on: [self-hosted, Linux, ARM64] + runs-on: [self-hosted, Linux, ARM64, rp2040] steps: - name: Clean workspace @@ -183,9 +176,9 @@ jobs: - name: Create flash.sh run: | - touch flash.sh + echo > flash.sh 'cmdout=$(openocd -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -c "program $1 reset exit")' + echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi' chmod +x flash.sh - echo > flash.sh 'openocd -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -c "program $1 reset exit"' - name: Test cdc_dual_ports run: | diff --git a/.github/workflows/build_esp.yml b/.github/workflows/build_esp.yml index 51d91de49..2e2859c95 100644 --- a/.github/workflows/build_esp.yml +++ b/.github/workflows/build_esp.yml @@ -1,11 +1,23 @@ name: Build ESP on: - pull_request: push: - release: - types: - - created + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + pull_request: + branches: [ master ] + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: build-esp: diff --git a/.github/workflows/build_msp430.yml b/.github/workflows/build_msp430.yml index b43d9e740..7e1c5b128 100644 --- a/.github/workflows/build_msp430.yml +++ b/.github/workflows/build_msp430.yml @@ -1,11 +1,23 @@ name: Build MSP430 on: - pull_request: push: - release: - types: - - created + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + pull_request: + branches: [ master ] + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: build-msp430: @@ -16,9 +28,12 @@ jobs: family: # Alphabetical order - 'msp430' + steps: - name: Setup Python uses: actions/setup-python@v4 + with: + python-version: '3.x' - name: Checkout TinyUSB uses: actions/checkout@v3 @@ -36,7 +51,7 @@ jobs: run: echo >> $GITHUB_ENV TOOLCHAIN_URL=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 - name: Cache Toolchain - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-toolchain with: path: ~/cache/ diff --git a/.github/workflows/build_renesas.yml b/.github/workflows/build_renesas.yml index d212708f7..d9254dea8 100644 --- a/.github/workflows/build_renesas.yml +++ b/.github/workflows/build_renesas.yml @@ -1,11 +1,23 @@ name: Build Renesas on: - pull_request: push: - release: - types: - - created + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + pull_request: + branches: [ master ] + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: build-rx: @@ -38,7 +50,7 @@ jobs: run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run - name: Cache Toolchain - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-toolchain with: path: ~/cache/ diff --git a/.github/workflows/build_riscv.yml b/.github/workflows/build_riscv.yml index 96b8c676b..026da7bdc 100644 --- a/.github/workflows/build_riscv.yml +++ b/.github/workflows/build_riscv.yml @@ -1,11 +1,23 @@ name: Build RISC-V on: - pull_request: push: - release: - types: - - created + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + pull_request: + branches: [ master ] + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: build-riscv: @@ -39,7 +51,7 @@ jobs: run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz - name: Cache Toolchain - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-toolchain with: path: ~/cache/ diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..8a1101ac0 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,46 @@ +name: pre-commit + +on: + push: + pull_request: + branches: [ master ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + + - name: Checkout TinyUSB + uses: actions/checkout@v3 + + - name: Run codespell + uses: codespell-project/actions-codespell@master + + - name: Run Unit Tests + run: | + # Install Ceedling + gem install ceedling + cd test/unit-test + ceedling test:all + + - name: Build Fuzzer + run: | + fuzz_harness=$(ls -d test/fuzz/device/*/) + for h in $fuzz_harness + do + make -C $h get-deps + make -C $h all + done diff --git a/.github/workflows/test_hardware.yml b/.github/workflows/test_hardware.yml new file mode 100644 index 000000000..601a97e99 --- /dev/null +++ b/.github/workflows/test_hardware.yml @@ -0,0 +1,94 @@ +name: Hardware Test + +on: + push: + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + pull_request: + branches: [ master ] + paths: + - 'src/**' + - 'examples/**' + - 'lib/**' + - 'hw/**' + +# Hardware in the loop (HIL) +# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user +# - STM32L412 Nucleo with on-board jlink as ttyACM0 + +jobs: + stm32l412nucleo-test: + runs-on: [self-hosted, Linux, X64, hifiphile] + + steps: + - name: Clean workspace + run: | + echo "Cleaning up previous run" + rm -rf "${{ github.workspace }}" + mkdir -p "${{ github.workspace }}" + + - name: Checkout TinyUSB + uses: actions/checkout@v3 + + - name: Get Dependencies and Build + run: | + git submodule update --init lib/FreeRTOS-Kernel lib/lwip + python3 tools/get_dependencies.py stm32l4 + python3 tools/build_family.py stm32l4 + + - name: Pick-up elf files + run: | + mkdir stm32l412nucleo/ + find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} stm32l412nucleo/ \; + + - name: Create flash.sh + run: | + echo > flash.sh 'echo halt > flash.jlink' + echo >> flash.sh 'echo r >> flash.jlink' + echo >> flash.sh 'echo loadfile stm32l412nucleo/$1 >> flash.jlink' + echo >> flash.sh 'echo r >> flash.jlink' + echo >> flash.sh 'echo go >> flash.jlink' + echo >> flash.sh 'echo exit >> flash.jlink' + echo >> flash.sh 'cmdout=$(JLinkExe -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -NoGui 1 -ExitOnError 1 -CommandFile flash.jlink)' + echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi' + chmod +x flash.sh + + - name: Test cdc_dual_ports + run: | + ./flash.sh cdc_dual_ports.elf + while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 5 ]; do :; done + test -e /dev/ttyACM1 && echo "ttyACM1 exists" + test -e /dev/ttyACM2 && echo "ttyACM2 exists" + + # Debian does not auto mount usb drive. skip this test for now + - name: Test cdc_msc + if: false + run: | + ./flash.sh cdc_msc.elf + readme='/media/pi/TinyUSB MSC/README.TXT' + while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 5 ]; do :; done + test -e /dev/ttyACM1 && echo "ttyACM1 exists" + test -f "$readme" && echo "$readme exists" + cat "$readme" + + - name: Test dfu + run: | + ./flash.sh dfu.elf + while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 5 ]; do :; done + dfu-util -d cafe -a 0 -U dfu0 + dfu-util -d cafe -a 1 -U dfu1 + grep "TinyUSB DFU! - Partition 0" dfu0 + grep "TinyUSB DFU! - Partition 1" dfu1 + + - name: Test dfu_runtime + run: | + ./flash.sh dfu_runtime.elf + while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done + +# - name: Test hid_boot_interface +# run: | +# ./flash.sh hid_boot_interface.elf +# while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done |
