summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.yml8
-rw-r--r--.github/workflows/build_aarch64.yml33
-rw-r--r--.github/workflows/build_arm.yml231
-rw-r--r--.github/workflows/build_esp.yml33
-rw-r--r--.github/workflows/build_iar.yml49
-rw-r--r--.github/workflows/build_msp430.yml43
-rw-r--r--.github/workflows/build_renesas.yml40
-rw-r--r--.github/workflows/build_riscv.yml41
-rw-r--r--.github/workflows/build_win_mac.yml53
-rw-r--r--.github/workflows/cifuzz.yml33
-rw-r--r--.github/workflows/pre-commit.yml47
-rw-r--r--.github/workflows/trigger.yml7
12 files changed, 503 insertions, 115 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 2958d3b12..dc5f0ee16 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -54,7 +54,7 @@ body:
Exact steps in chronological order, details should be specific e.g if you use a command/script to test with, please post it as well.
1. Go to '...'
2. Click on '....'
- 3. See error
+ 3. See error
validations:
required: true
@@ -63,9 +63,9 @@ body:
label: Debug Log as txt file
placeholder: |
Attach your debug log txt file here, where the issue occurred, best with comments to explain the actual events.
-
- Note1: Please DO NOT paste your lengthy log contents here since it hurts the readibility.
- Note2: To enable logging, add `LOG=3` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=3` in your tusb_config.h.
+
+ Note1: Please DO NOT paste your lengthy log contents here since it hurts the readability.
+ Note2: To enable logging, add `LOG=3` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=3` in your tusb_config.h.
More information can be found at [example's readme](https://github.com/hathach/tinyusb/blob/master/docs/getting_started.md)
validations:
required: false
diff --git a/.github/workflows/build_aarch64.yml b/.github/workflows/build_aarch64.yml
index b4ea8a0eb..cc8ddb070 100644
--- a/.github/workflows/build_aarch64.yml
+++ b/.github/workflows/build_aarch64.yml
@@ -1,11 +1,25 @@
name: Build AArch64
on:
- pull_request:
push:
- release:
- types:
- - created
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_aarch64.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_aarch64.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
jobs:
# ---------------------------------------
@@ -21,14 +35,13 @@ jobs:
- 'broadcom_64bit'
steps:
- name: Setup Python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
-
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@@ -39,7 +52,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/
@@ -56,7 +69,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
- run: python3 tools/get_dependencies.py ${{ matrix.family }}
+ run: python3 tools/get_family_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml
index 4297ba895..7aecb8386 100644
--- a/.github/workflows/build_arm.yml
+++ b/.github/workflows/build_arm.yml
@@ -1,34 +1,27 @@
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'
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_arm.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_arm.yml'
- - name: Checkout TinyUSB
- uses: actions/checkout@v3
-
- - 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
# ---------------------------------------
@@ -41,31 +34,28 @@ jobs:
# Alphabetical order
- 'broadcom_32bit'
- 'imxrt'
- - 'lpc15'
- - 'lpc18'
- - 'lpc54'
- - 'lpc55'
- - 'mm32'
- - 'msp432e4'
+ - 'lpc15 lpc18'
+ - 'lpc54 lpc55'
+ - 'mm32 msp432e4'
- 'nrf'
+ - 'ra'
- 'rp2040'
- 'samd11'
- 'samd21'
- 'samd51'
- 'saml2x'
- - 'stm32f0'
- - 'stm32f1'
+ - 'stm32f0 stm32f1'
- 'stm32f4'
- 'stm32f7'
- - 'stm32g4'
+ - 'stm32g4 stm32wb'
- 'stm32h7'
- 'stm32l4'
- - 'stm32wb'
- - 'tm4c123'
- - 'xmc4000'
+ - 'tm4c123 xmc4000'
steps:
- name: Setup Python
- uses: actions/setup-python@v3
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
@@ -75,9 +65,6 @@ jobs:
- name: Checkout TinyUSB
uses: actions/checkout@v3
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
-
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@@ -91,7 +78,7 @@ jobs:
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
- name: Get Dependencies
- run: python3 tools/get_dependencies.py ${{ matrix.family }}
+ run: python3 tools/get_family_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@@ -99,16 +86,37 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
- for ex in `ls -d examples/device/*/`; do \
- find ${ex} -name *.map -print -quit | \
- xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
+ # find -quit to only print linkermap of 1 board per example
+ for ex in `ls -d examples/*/*/`
+ do
+ find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done
+ # Upload binaries for rp2040/stm32l412nucleo hardware test with self-hosted
+
+ - name: Prepare rp2040 Artifacts
+ if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
+ run: find examples/ -name "*.elf" -exec mv {} . \;
+
+ - name: Prepare stm32l412nucleo Artifacts
+ if: matrix.family == 'stm32l4'
+ run: find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} . \;
+
+ - name: Upload Artifacts for hardware testing
+ if: matrix.family == 'stm32l4' || (matrix.family == 'rp2040' && github.repository_owner == 'hathach')
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ matrix.family }}
+ path: |
+ *.elf
+
# ---------------------------------------
# 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:
@@ -122,7 +130,9 @@ jobs:
steps:
- name: Setup Python
- uses: actions/setup-python@v3
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
@@ -132,8 +142,131 @@ jobs:
- name: Checkout TinyUSB
uses: actions/checkout@v3
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- name: Build
run: python3 tools/build_board.py ${{ matrix.example }}
+
+ # ---------------------------------------
+ # Hardware in the loop (HIL)
+ # Current self-hosted instance is running on an RPI4 with
+ # - pico + pico-probe connected via USB
+ # - pico-probe is /dev/ttyACM0
+ # ---------------------------------------
+ hw-rp2040-test:
+ # run only with hathach's commit due to limited resource on RPI4
+ if: github.repository_owner == 'hathach'
+ needs: build-arm
+ runs-on: [self-hosted, Linux, ARM64, rp2040]
+
+ steps:
+ - name: Clean workspace
+ run: |
+ echo "Cleaning up previous run"
+ rm -rf "${{ github.workspace }}"
+ mkdir -p "${{ github.workspace }}"
+
+ - name: Download rp2040 Artifacts
+ uses: actions/download-artifact@v3
+ with:
+ name: rp2040
+
+ - name: Create flash.sh
+ run: |
+ #echo > flash.sh 'cmdout=$(openocd -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -c "program $1 reset exit")'
+ echo > flash.sh 'pyocd flash -t rp2040 $1'
+ 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 10 ]; do :; done
+ test -e /dev/ttyACM1 && echo "ttyACM1 exists"
+ test -e /dev/ttyACM2 && echo "ttyACM2 exists"
+
+ - name: Test cdc_msc
+ run: |
+ ./flash.sh cdc_msc.elf
+ readme='/media/pi/TinyUSB MSC/README.TXT'
+ while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; 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 10 ]; 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 10 ]; do :; done
+
+ # ---------------------------------------
+ # 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
+ # ---------------------------------------
+ hw-stm32l412nucleo-test:
+ needs: build-arm
+ 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: Download stm32l4 Artifacts
+ uses: actions/download-artifact@v3
+ with:
+ name: stm32l4
+
+ - name: Create flash.sh
+ run: |
+ echo > flash.sh 'echo halt > flash.jlink'
+ echo >> flash.sh 'echo r >> flash.jlink'
+ echo >> flash.sh 'echo loadfile $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 10 ]; 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 10 ]; 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 10 ]; 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 10 ]; do :; done
diff --git a/.github/workflows/build_esp.yml b/.github/workflows/build_esp.yml
index 6a46773b2..dbc51a60f 100644
--- a/.github/workflows/build_esp.yml
+++ b/.github/workflows/build_esp.yml
@@ -1,11 +1,25 @@
name: Build ESP
on:
- pull_request:
push:
- release:
- types:
- - created
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_esp.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_esp.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
jobs:
build-esp:
@@ -23,7 +37,9 @@ jobs:
steps:
- name: Setup Python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
- name: Pull ESP-IDF docker
run: docker pull espressif/idf:latest
@@ -43,7 +59,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
- for ex in `ls -d examples/device/*/`; do \
- find ${ex} -maxdepth 3 -name *.map -print -quit | \
- xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
+ # find -quit to only print linkermap of 1 board per example
+ for ex in `ls -d examples/device/*/`
+ do
+ find ${ex} -maxdepth 3 -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done
diff --git a/.github/workflows/build_iar.yml b/.github/workflows/build_iar.yml
new file mode 100644
index 000000000..a5d24892f
--- /dev/null
+++ b/.github/workflows/build_iar.yml
@@ -0,0 +1,49 @@
+name: Build IAR
+
+on:
+ push:
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_iar.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_iar.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ build-arm:
+ runs-on: [self-hosted, Linux, X64, hifiphile]
+ strategy:
+ fail-fast: false
+ matrix:
+ family:
+ # Alphabetical order
+ # Note: bundle multiple families into a matrix since there is only one self-hosted instance can
+ # run IAR build. Too many matrix can hurt due to setup/teardown overhead.
+ - 'stm32f0 stm32f1 stm32f4 stm32f7 stm32g4 stm32h7 stm32l4'
+ 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
+ run: python3 tools/get_family_deps.py ${{ matrix.family }}
+
+ - name: Build
+ run: python3 tools/build_family.py ${{ matrix.family }} CC=iccarm
diff --git a/.github/workflows/build_msp430.yml b/.github/workflows/build_msp430.yml
index ea93f09a0..7cb60dceb 100644
--- a/.github/workflows/build_msp430.yml
+++ b/.github/workflows/build_msp430.yml
@@ -1,13 +1,27 @@
name: Build MSP430
on:
- pull_request:
push:
- release:
- types:
- - created
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_msp430.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_msp430.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
-jobs:
+jobs:
build-msp430:
runs-on: ubuntu-latest
strategy:
@@ -16,16 +30,16 @@ jobs:
family:
# Alphabetical order
- 'msp430'
+
steps:
- name: Setup Python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@@ -36,7 +50,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/
@@ -53,7 +67,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
- run: python3 tools/get_dependencies.py ${{ matrix.family }}
+ run: python3 tools/get_family_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@@ -61,7 +75,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
- for ex in `ls -d examples/device/*/`; do \
- find ${ex} -name *.map -print -quit | \
- xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
+ # find -quit to only print linkermap of 1 board per example
+ for ex in `ls -d examples/device/*/`
+ do
+ find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done
diff --git a/.github/workflows/build_renesas.yml b/.github/workflows/build_renesas.yml
index 2563d3549..ffdeedb71 100644
--- a/.github/workflows/build_renesas.yml
+++ b/.github/workflows/build_renesas.yml
@@ -1,11 +1,25 @@
name: Build Renesas
on:
- pull_request:
push:
- release:
- types:
- - created
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_renesas.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_renesas.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
jobs:
build-rx:
@@ -18,14 +32,13 @@ jobs:
- 'rx'
steps:
- name: Setup Python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@@ -36,7 +49,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/
@@ -54,7 +67,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
- run: python3 tools/get_dependencies.py ${{ matrix.family }}
+ run: python3 tools/get_family_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@@ -62,7 +75,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
- for ex in `ls -d examples/device/*/`; do \
- find ${ex} -name *.map -print -quit | \
- xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
+ # find -quit to only print linkermap of 1 board per example
+ for ex in `ls -d examples/device/*/`
+ do
+ find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done
diff --git a/.github/workflows/build_riscv.yml b/.github/workflows/build_riscv.yml
index 90dc35206..87c7b522e 100644
--- a/.github/workflows/build_riscv.yml
+++ b/.github/workflows/build_riscv.yml
@@ -1,11 +1,25 @@
name: Build RISC-V
on:
- pull_request:
push:
- release:
- types:
- - created
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_riscv.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_riscv.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
jobs:
build-riscv:
@@ -15,18 +29,18 @@ jobs:
matrix:
family:
# Alphabetical order
+ - 'ch32v307'
- 'fomu'
- 'gd32vf103'
steps:
- name: Setup Python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@@ -37,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/
@@ -54,7 +68,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
- run: python3 tools/get_dependencies.py ${{ matrix.family }}
+ run: python3 tools/get_family_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@@ -62,7 +76,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
- for ex in `ls -d examples/device/*/`; do \
- find ${ex} -name *.map -print -quit | \
- xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
+ # find -quit to only print linkermap of 1 board per example
+ for ex in `ls -d examples/device/*/`
+ do
+ find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done
diff --git a/.github/workflows/build_win_mac.yml b/.github/workflows/build_win_mac.yml
new file mode 100644
index 000000000..4b743a686
--- /dev/null
+++ b/.github/workflows/build_win_mac.yml
@@ -0,0 +1,53 @@
+name: Build Windows/MacOS
+
+on:
+ push:
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_win_mac.yml'
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'hw/**'
+ - '.github/workflows/build_win_mac.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ # ---------------------------------------
+ # Build ARM family
+ # ---------------------------------------
+ build-arm:
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [windows-latest, macos-latest]
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
+
+ - name: Install ARM GCC
+ uses: carlosperate/arm-none-eabi-gcc-action@v1
+ with:
+ release: '10.3-2021.10'
+
+ - name: Checkout TinyUSB
+ uses: actions/checkout@v3
+
+ - name: Get Dependencies
+ run: python3 tools/get_family_deps.py stm32f4
+
+ - name: Build
+ run: python3 tools/build_family.py stm32f4 stm32f411disco
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
new file mode 100644
index 000000000..7314fd9e6
--- /dev/null
+++ b/.github/workflows/cifuzz.yml
@@ -0,0 +1,33 @@
+name: CIFuzz
+on:
+ pull_request:
+ branches:
+ - master
+ paths:
+ - '**.c'
+ - '**.cc'
+ - '**.cpp'
+ - '**.cxx'
+ - '**.h'
+jobs:
+ Fuzzing:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Build Fuzzers
+ id: build
+ uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'tinyusb'
+ language: c++
+ - name: Run Fuzzers
+ uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'tinyusb'
+ language: c++
+ fuzz-seconds: 600
+ - name: Upload Crash
+ uses: actions/upload-artifact@v3
+ if: failure() && steps.build.outcome == 'success'
+ with:
+ name: artifacts
+ path: ./out/artifacts
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
new file mode 100644
index 000000000..ab416bc52
--- /dev/null
+++ b/.github/workflows/pre-commit.yml
@@ -0,0 +1,47 @@
+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: Get Dependencies
+ run: |
+ gem install ceedling
+ #cd test/unit-test
+ #ceedling test:all
+
+ - name: Run pre-commit
+ uses: pre-commit/[email protected]
+
+ - name: Build Fuzzer
+ run: |
+ export CC=clang
+ export CXX=clang++
+ 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/trigger.yml b/.github/workflows/trigger.yml
index e434ca238..86c699dac 100644
--- a/.github/workflows/trigger.yml
+++ b/.github/workflows/trigger.yml
@@ -43,7 +43,7 @@ jobs:
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit --message "Update from https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA"
- git push
+ git push
fi
- name: Create tinyusb_src Release
@@ -53,8 +53,7 @@ jobs:
cd tinyusb_src
git tag ${{ github.event.release.tag_name }}
git push origin ${{ github.event.release.tag_name }}
-
+
# Send POST reqwuest to release https://docs.github.com/en/rest/reference/repos#create-a-release
- bb={{ github.event.release.body }}
- bb=${bb//\n/\\\n}
+ bb="For release note, please checkout https://github.com/hathach/tinyusb/releases/tag/${{ github.event.release.tag_name }}"
curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.v3+json" --data '{"tag_name": "${{ github.event.release.tag_name }}", "name": "${{ github.event.release.name }}", "body": "$bb", "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}}' https://api.github.com/repos/hathach/tinyusb_src/releases