Repository navigation
fix(can): 连续多包发送,使传输顺序与应用层调用一致 #5389
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Automation utest run script for the QEMU platform | |
| # Generate the corresponding config configuration for CI based on the configuration file under .github/utest/configs. | |
| name: utest_auto_run | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - '.github/workflows/utest_auto_run.yml' | |
| - '.github/utest/configs/**' | |
| - 'Kconfig' | |
| - 'components/utilities/utest/Kconfig' | |
| - 'bsp/qemu-vexpress-a9/**' | |
| - 'bsp/qemu-virt64-aarch64/**' | |
| - 'bsp/qemu-virt64-riscv/**' | |
| - 'bsp/xuantie/virt64/c906/**' | |
| - 'components/**' | |
| - 'examples/utest/**' | |
| - 'include/**' | |
| - 'libcpu/**' | |
| - 'src/**' | |
| - 'tools/**' | |
| - '!**/README.md' | |
| - '!**/README_zh.md' | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - '.github/workflows/utest_auto_run.yml' | |
| - '.github/utest/configs/**' | |
| - 'Kconfig' | |
| - 'components/utilities/utest/Kconfig' | |
| - 'bsp/qemu-vexpress-a9/**' | |
| - 'bsp/qemu-virt64-aarch64/**' | |
| - 'bsp/qemu-virt64-riscv/**' | |
| - 'bsp/xuantie/virt64/c906/**' | |
| - 'components/**' | |
| - 'examples/utest/**' | |
| - 'include/**' | |
| - 'libcpu/**' | |
| - 'src/**' | |
| - 'tools/**' | |
| - '!**/README.md' | |
| - '!**/README_zh.md' | |
| workflow_dispatch: | |
| inputs: | |
| trigger_type: | |
| description: '触发类型' | |
| required: false | |
| default: 'manual' | |
| type: string | |
| utest_loop: | |
| description: '自动运行重复次数 (1-18),大于 1 时每轮结束后执行 free/ps 观测内存与线程变化' | |
| required: false | |
| default: '1' | |
| type: string | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| name: ${{ matrix.platform.UTEST }} :${{ matrix.config_file }} | |
| if: github.repository_owner == 'RT-Thread' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| - { UTEST: "A9-rtsmart", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| - { UTEST: "A9-smp", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"smp" } | |
| - { UTEST: "RISCV", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"" } | |
| - { UTEST: "RISCV-rtsmart", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| - { UTEST: "RISCV-smp", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"smp" } | |
| - { UTEST: "XUANTIE-rtsmart", RTT_BSP: "bsp/xuantie/virt64/c906", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| - { UTEST: "AARCH64", RTT_BSP: "bsp/qemu-virt64-aarch64", QEMU_ARCH: "aarch64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| - { UTEST: "AARCH64-rtsmart", RTT_BSP: "bsp/qemu-virt64-aarch64", QEMU_ARCH: "aarch64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| - { UTEST: "AARCH64-smp", RTT_BSP: "bsp/qemu-virt64-aarch64", QEMU_ARCH: "aarch64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"smp" } | |
| - { UTEST: "AARCH64", RTT_BSP: "bsp/zynqmp-a53-dfzu2eg", QEMU_ARCH: "aarch64", QEMU_MACHINE: "xlnx-zcu102", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"" } | |
| - { UTEST: "AARCH64-rtsmart", RTT_BSP: "bsp/zynqmp-a53-dfzu2eg", QEMU_ARCH: "aarch64", QEMU_MACHINE: "xlnx-zcu102", SD_FILE: "None", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| - { UTEST: "AARCH64-smp", RTT_BSP: "bsp/zynqmp-a53-dfzu2eg", QEMU_ARCH: "aarch64", QEMU_MACHINE: "xlnx-zcu102", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"smp" } | |
| config_file: | |
| - "default.cfg" | |
| include: | |
| # run kernel utest set on all QEMU boards | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/kernel_basic.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/ipc.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "A9-rtsmart", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/kernel_basic.cfg" | |
| - platform: { UTEST: "A9-rtsmart", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/ipc.cfg" | |
| - platform: { UTEST: "A9-rtsmart", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "A9-smp", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"smp" } | |
| config_file: "kernel/kernel_basic.cfg" | |
| - platform: { UTEST: "A9-smp", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"smp" } | |
| config_file: "kernel/ipc.cfg" | |
| - platform: { UTEST: "A9-smp", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"smp" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "RISCV", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/kernel_basic.cfg" | |
| - platform: { UTEST: "RISCV", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/ipc.cfg" | |
| - platform: { UTEST: "RISCV", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "RISCV-rtsmart", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/kernel_basic.cfg" | |
| - platform: { UTEST: "RISCV-rtsmart", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/ipc.cfg" | |
| - platform: { UTEST: "RISCV-rtsmart", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "XUANTIE-rtsmart", RTT_BSP: "bsp/xuantie/virt64/c906", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/kernel_basic.cfg" | |
| - platform: { UTEST: "XUANTIE-rtsmart", RTT_BSP: "bsp/xuantie/virt64/c906", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/ipc.cfg" | |
| - platform: { UTEST: "XUANTIE-rtsmart", RTT_BSP: "bsp/xuantie/virt64/c906", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "RISCV-smp", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"smp" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "AARCH64", RTT_BSP: "bsp/qemu-virt64-aarch64", QEMU_ARCH: "aarch64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "AARCH64-rtsmart", RTT_BSP: "bsp/qemu-virt64-aarch64", QEMU_ARCH: "aarch64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "rtsmart", "SMP_RUN":"" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "AARCH64-smp", RTT_BSP: "bsp/qemu-virt64-aarch64", QEMU_ARCH: "aarch64", QEMU_MACHINE: "virt", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"smp" } | |
| config_file: "kernel/mem.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/atomic_c11.cfg" | |
| - platform: { UTEST: "RISCV", RTT_BSP: "bsp/qemu-virt64-riscv", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", SD_FILE: "None", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "kernel/atomic_c11.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "cpp11/cpp11.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/lwip.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/netdev.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/sal.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/dfs.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/libc.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/spi.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/dac.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/i2c.cfg" | |
| - platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" } | |
| config_file: "components/dlmodule.cfg" | |
| env: | |
| TEST_QEMU_ARCH: ${{ matrix.platform.QEMU_ARCH }} | |
| TEST_QEMU_MACHINE: ${{ matrix.platform.QEMU_MACHINE }} | |
| TEST_BSP_ROOT: ${{ matrix.platform.RTT_BSP }} | |
| TEST_CONFIG_FILE: ${{ matrix.config_file }} | |
| TEST_SD_FILE: ${{ matrix.platform.SD_FILE }} | |
| UTEST_CONFIG_ROOT: .github/utest/configs | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: Install Tools | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -yqq install scons qemu-system git device-tree-compiler | |
| pip3 install kconfiglib | |
| - name: Install ToolChains | |
| shell: bash | |
| run: | | |
| TOOLCHAIN_INSTALLED="" | |
| # Install Arm ToolChains | |
| if [[ "${{ matrix.platform.QEMU_ARCH }}" == "arm" && "${{ matrix.platform.KERNEL }}" == "standard" ]]; then | |
| echo "Starting install Arm ToolChains" | |
| wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.3/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | |
| sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt | |
| /opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version | |
| echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV | |
| echo "RTT_CC_PREFIX=arm-none-eabi-" >> $GITHUB_ENV | |
| echo "TOOLCHAIN_INSTALLED=arm" >> $GITHUB_ENV | |
| fi | |
| # Install Arm Musl ToolChains | |
| if [[ "${{ matrix.platform.QEMU_ARCH }}" == "arm" && "${{ matrix.platform.KERNEL }}" == "rtsmart" ]]; then | |
| echo "Starting install Arm Musl ToolChains" | |
| wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/arm-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2 | |
| sudo tar xjf arm-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2 -C /opt | |
| /opt/arm-linux-musleabi_for_x86_64-pc-linux-gnu/bin/arm-linux-musleabi-gcc --version | |
| echo "RTT_EXEC_PATH=/opt/arm-linux-musleabi_for_x86_64-pc-linux-gnu/bin" >> $GITHUB_ENV | |
| echo "RTT_CC_PREFIX=arm-linux-musleabi-" >> $GITHUB_ENV | |
| echo "TOOLCHAIN_INSTALLED=arm-musl" >> $GITHUB_ENV | |
| fi | |
| # Install RISC-V ToolChains | |
| if [[ "${{ matrix.platform.QEMU_ARCH }}" == "riscv64" && "${{ matrix.platform.KERNEL }}" == "standard" ]]; then | |
| echo "Starting install RISC-V ToolChains" | |
| wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.4/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz | |
| sudo tar zxvf riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz -C /opt | |
| /opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin/riscv64-unknown-elf-gcc --version | |
| echo "RTT_EXEC_PATH=/opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_ENV | |
| echo "TOOLCHAIN_INSTALLED=riscv" >> $GITHUB_ENV | |
| fi | |
| # Install RISC-V Musl ToolChains | |
| if [[ "${{ matrix.platform.QEMU_ARCH }}" == "riscv64" && "${{ matrix.platform.KERNEL }}" == "rtsmart" ]]; then | |
| echo "Starting install RISC-V Musl ToolChains" | |
| wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_latest.tar.bz2 | |
| sudo tar xjf riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_latest.tar.bz2 -C /opt | |
| /opt/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/bin/riscv64-unknown-linux-musl-gcc --version | |
| echo "RTT_EXEC_PATH=/opt/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/bin" >> $GITHUB_ENV | |
| echo "RTT_CC_PREFIX=riscv64-unknown-linux-musl-" >> $GITHUB_ENV | |
| echo "TOOLCHAIN_INSTALLED=riscv-musl" >> $GITHUB_ENV | |
| fi | |
| # Install RISC-V XUANTIE Musl ToolChains | |
| if [[ "${{ matrix.platform.UTEST }}" == "XUANTIE-rtsmart" && "${{ matrix.platform.QEMU_ARCH }}" == "riscv64" && "${{ matrix.platform.KERNEL }}" == "rtsmart" ]]; then | |
| echo "Starting install RISC-V XUANTIE Musl ToolChains" | |
| wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.9/Xuantie-900-gcc-linux-6.6.0-musl64-x86_64-V3.0.2.tar.gz | |
| sudo tar zxvf Xuantie-900-gcc-linux-6.6.0-musl64-x86_64-V3.0.2.tar.gz -C /opt | |
| /opt/Xuantie-900-gcc-linux-6.6.0-musl64-x86_64-V3.0.2/bin/riscv64-unknown-linux-musl-gcc --version | |
| echo "RTT_EXEC_PATH=/opt/Xuantie-900-gcc-linux-6.6.0-musl64-x86_64-V3.0.2/bin" >> $GITHUB_ENV | |
| echo "RTT_CC_PREFIX=riscv64-unknown-linux-musl-" >> $GITHUB_ENV | |
| echo "TOOLCHAIN_INSTALLED=riscv-musl" >> $GITHUB_ENV | |
| fi | |
| # Install AARCH64 ToolChains | |
| if [[ "${{ matrix.platform.QEMU_ARCH }}" == "aarch64" && "${{ matrix.platform.KERNEL }}" == "standard" ]]; then | |
| echo "Starting install AARCH64 ToolChains" | |
| wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.6/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz | |
| sudo tar -xvJf gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz -C /opt | |
| /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc --version | |
| echo "RTT_EXEC_PATH=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin" >> $GITHUB_ENV | |
| echo "RTT_CC_PREFIX=aarch64-none-elf-" >> $GITHUB_ENV | |
| echo "TOOLCHAIN_INSTALLED=aarch64" >> $GITHUB_ENV | |
| fi | |
| # Install AARCH64 Musl ToolChains | |
| if [[ "${{ matrix.platform.QEMU_ARCH }}" == "aarch64" && "${{ matrix.platform.KERNEL }}" == "rtsmart" ]]; then | |
| echo "Starting install AARCH64 Musl ToolChains" | |
| wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2 | |
| sudo tar xjf aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2 -C /opt | |
| /opt/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu/bin/aarch64-linux-musleabi-gcc --version | |
| echo "RTT_EXEC_PATH=/opt/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu/bin" >> $GITHUB_ENV | |
| echo "RTT_CC_PREFIX=aarch64-linux-musleabi-" >> $GITHUB_ENV | |
| echo "TOOLCHAIN_INSTALLED=aarch64-musl" >> $GITHUB_ENV | |
| fi | |
| # Install CPP11 Preprocessing Toolchain | |
| if [[ "${{ matrix.platform.QEMU_ARCH }}" == "arm" && "${{ matrix.config_file }}" == "cpp11/cpp11.cfg" && "${{ matrix.platform.KERNEL }}" == "standard" ]]; then | |
| sudo rm -f /opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/thread | |
| sudo rm -f /opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/mutex | |
| sudo rm -f /opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/condition_variable | |
| sudo rm -f /opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/future | |
| sudo rm -f /opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/pthread.h | |
| sudo cat /dev/null > /opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_pthreadtypes.h | |
| sed -i 's/-fno-exceptions/ /g' $TEST_BSP_ROOT/rtconfig.py | |
| fi | |
| if [ "$TOOLCHAIN_INSTALLED" == "None" ]; then | |
| echo "No valid toolchain installed, stopping the workflow." | |
| fi | |
| - name: Build BSP | |
| if: ${{ env.TOOLCHAIN_INSTALLED != '' && success() }} | |
| env: | |
| # Passed through env rather than interpolated into the script, so a value | |
| # like "$(...)" or a backtick can never be executed by the shell. | |
| UTEST_LOOP_INPUT: ${{ github.event.inputs.utest_loop }} | |
| run: | | |
| # Validate the loop count before anything is appended to .config. The value | |
| # must be a plain decimal integer in 1..18: 18 loops x 20 minutes is the | |
| # 360 minute step budget of the monitor step, so a larger value could only | |
| # be cancelled by GitHub without a useful message. | |
| UTEST_LOOP="${UTEST_LOOP_INPUT:-1}" | |
| case "$UTEST_LOOP" in | |
| ''|*[!0-9]*) | |
| echo "ERROR: utest_loop must be a decimal integer in 1..18, got '$UTEST_LOOP'" | |
| exit 1 | |
| ;; | |
| esac | |
| # 10# forces a decimal parse, so 08/09 are not treated as octal | |
| UTEST_LOOP=$((10#$UTEST_LOOP)) | |
| if [ "$UTEST_LOOP" -lt 1 ] || [ "$UTEST_LOOP" -gt 18 ]; then | |
| echo "ERROR: utest_loop must be in 1..18, got '$UTEST_LOOP'" | |
| exit 1 | |
| fi | |
| echo "UTEST_LOOP=$UTEST_LOOP" >> $GITHUB_ENV | |
| echo "utest auto run loop: $UTEST_LOOP" | |
| # Keep regular RISC-V jobs UP; SMP coverage has its own matrix entry. | |
| if [[ "$TEST_BSP_ROOT" == "bsp/qemu-virt64-riscv" && "${{ matrix.platform.SMP_RUN }}" != "smp" ]]; then | |
| echo "# CONFIG_RT_USING_SMP is not set" >> $TEST_BSP_ROOT/.config | |
| echo "CONFIG_RT_CPUS_NR=1" >> $TEST_BSP_ROOT/.config | |
| fi | |
| # Whether plan to run SMP? | |
| if [[ "${{ matrix.platform.SMP_RUN }}" == "smp" ]]; then | |
| cat $UTEST_CONFIG_ROOT/smp/smp.cfg >> $TEST_BSP_ROOT/.config | |
| echo >> $TEST_BSP_ROOT/.config | |
| fi | |
| # Is the kernel rtsmart? | |
| if [[ "${{ matrix.platform.KERNEL }}" == "rtsmart" ]]; then | |
| cat $UTEST_CONFIG_ROOT/rtsmart/rtsmart.cfg >> $TEST_BSP_ROOT/.config | |
| echo >> $TEST_BSP_ROOT/.config | |
| elif [[ "$TEST_BSP_ROOT" == "bsp/qemu-virt64-riscv" || "$TEST_BSP_ROOT" == "bsp/qemu-virt64-aarch64" ]]; then | |
| # Select the standard kernel without overwriting the SMP configuration. | |
| echo "# CONFIG_RT_USING_SMART is not set" >> $TEST_BSP_ROOT/.config | |
| fi | |
| echo CONFIG_RT_USING_UTESTCASES=y >> $TEST_BSP_ROOT/.config | |
| cat $UTEST_CONFIG_ROOT/$TEST_CONFIG_FILE >> $TEST_BSP_ROOT/.config | |
| echo >> $TEST_BSP_ROOT/.config | |
| # Repeat the automatic utest run when a loop count is requested, so that | |
| # resources leaked by a test case show up as growing memory/threads. | |
| if [ "$UTEST_LOOP" -ne 1 ]; then | |
| echo "CONFIG_RT_UTEST_AUTO_RUN_LOOP=$UTEST_LOOP" >> $TEST_BSP_ROOT/.config | |
| fi | |
| # Keep standard qemu tests free of PM/tickless side effects. | |
| if [[ "${{ matrix.platform.KERNEL }}" == "standard" && ( "$TEST_BSP_ROOT" == "bsp/qemu-virt64-riscv" || "$TEST_BSP_ROOT" == "bsp/qemu-virt64-aarch64" ) ]]; then | |
| echo "# CONFIG_RT_USING_PM is not set" >> $TEST_BSP_ROOT/.config | |
| fi | |
| scons --pyconfig-silent -C $TEST_BSP_ROOT | |
| if [[ "$TEST_CONFIG_FILE" == "components/dlmodule.cfg" ]]; then | |
| grep -q '^#define RT_UTEST_DLMODULE' $TEST_BSP_ROOT/rtconfig.h | |
| python3 tools/ci/test_run_dlmodule_qemu.py | |
| fi | |
| scons -j$(nproc) --strict -C $TEST_BSP_ROOT | |
| - name: QEMU Run Test | |
| if: ${{ env.TOOLCHAIN_INSTALLED != '' && success() }} | |
| # qemu-virt64-riscv standard kernel utests are timing/scheduling sensitive and known to be flaky. | |
| continue-on-error: ${{ matrix.platform.UTEST == 'RISCV' && (matrix.config_file == 'kernel/ipc.cfg' || matrix.config_file == 'kernel/kernel_basic.cfg') }} | |
| run: | | |
| if [ "$TEST_SD_FILE" != "None" ]; then | |
| dd if=/dev/zero of=$TEST_BSP_ROOT/sd.bin bs=1024 count=65536 | |
| mkfs.fat $TEST_BSP_ROOT/sd.bin | |
| fi | |
| if [[ "$TEST_CONFIG_FILE" == "components/dlmodule.cfg" ]]; then | |
| python3 tools/ci/run_dlmodule_qemu.py --kernel $TEST_BSP_ROOT/rtthread.bin \ | |
| --disk $TEST_BSP_ROOT/sd.bin --log qemu_output_$TEST_QEMU_ARCH.log | |
| elif [[ "${{ matrix.platform.QEMU_ARCH }}" == "aarch64" ]]; then | |
| sudo apt-get -yqq install device-tree-compiler | |
| if [[ "${{ matrix.platform.QEMU_MACHINE }}" == "virt" ]]; then | |
| qemu-system-$TEST_QEMU_ARCH -M virt -cpu max -smp 4 -m 128M -kernel $TEST_BSP_ROOT/rtthread.bin -nographic \ | |
| -append "console=ttyAMA0 earlycon cma=8M coherent_pool=2M root=vda0 rootfstype=elm rootwait rw" \ | |
| -drive if=none,file=$TEST_BSP_ROOT/sd.bin,format=raw,id=blk0 -device virtio-blk-device,drive=blk0 \ | |
| -netdev user,id=net0 -device virtio-net-device,netdev=net0,bus=virtio-mmio-bus.1 \ | |
| > qemu_output_$TEST_QEMU_ARCH.log 2>&1 & | |
| elif [[ "${{ matrix.platform.QEMU_MACHINE }}" == "xlnx-zcu102" ]]; then | |
| heap=$(grep -E '^#define[[:space:]]+ARCH_HEAP_SIZE' $TEST_BSP_ROOT/rtconfig.h | awk '{print $3}') | |
| page=$(grep -E '^#define[[:space:]]+ARCH_INIT_PAGE_SIZE' $TEST_BSP_ROOT/rtconfig.h | awk '{print $3}') | |
| heap=$(echo "$heap" | tr -d '()') | |
| page=$(echo "$page" | tr -d '()') | |
| heap_val=$((heap)) | |
| page_val=$((page)) | |
| mem=$((heap_val + page_val)) | |
| mem=$((128 + mem / (1024 * 1024))) | |
| qemu-system-$TEST_QEMU_ARCH -M xlnx-zcu102 -m $mem -kernel $TEST_BSP_ROOT/rtthread.bin -nographic \ | |
| > qemu_output_$TEST_QEMU_ARCH.log 2>&1 & | |
| fi | |
| elif [[ "${{ matrix.platform.UTEST }}" == "XUANTIE-rtsmart" ]]; then | |
| sudo apt-get install -y dos2unix libcapstone-dev libbrlapi-dev | |
| wget -q https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1736318325160/Xuantie-qemu-x86_64-Ubuntu-20.04-V5.0.5-B20250108-0335.tar.gz | |
| tar zxvf Xuantie-qemu-x86_64-Ubuntu-20.04-V5.0.5-B20250108-0335.tar.gz | |
| dos2unix ./install/qemu_post_install_small.sh | |
| sudo chmod +x ./install/qemu_post_install_small.sh | |
| sudo ./install/qemu_post_install_small.sh | |
| QEMU_BIN="./install/bin/qemu-system-$TEST_QEMU_ARCH" | |
| [ ! -f "$QEMU_BIN" ] && echo "ERROR: $QEMU_BIN not found." && exit 1 | |
| tmp_output=$(mktemp) | |
| ldd "$QEMU_BIN" > "$tmp_output" 2>&1 | |
| missing_libs=$(grep "not found" "$tmp_output" | awk '{print $1}') | |
| for lib in $missing_libs; do | |
| base_lib=$(echo "$lib" | sed -E 's/\.so.*/\.so/') | |
| echo "🔍 修复基础库:$base_lib ..." | |
| sudo ln -s /usr/lib/x86_64-linux-gnu/$base_lib /usr/lib/x86_64-linux-gnu/$lib | |
| done | |
| echo "✅ 所有缺失库已处理。" | |
| $QEMU_BIN -cpu c906fd -M $TEST_QEMU_MACHINE -kernel $TEST_BSP_ROOT/rtthread.bin -nographic \ | |
| -drive if=none,file=$TEST_BSP_ROOT/sd.bin,format=raw,id=blk0 -device virtio-blk-device,drive=blk0,bus=virtio-mmio-bus.0 \ | |
| > qemu_output_$TEST_QEMU_ARCH.log 2>&1 & | |
| elif [[ "$TEST_BSP_ROOT" == "bsp/qemu-virt64-riscv" ]]; then | |
| cpus=$(grep -E '^#define[[:space:]]+RT_CPUS_NR' "$TEST_BSP_ROOT/rtconfig.h" | awk '{print $3}') | |
| cpus=${cpus:-1} | |
| dtb_args=() | |
| if [[ "${{ matrix.platform.KERNEL }}" == "rtsmart" ]]; then | |
| # QEMU 6.2 has no satp-mode CPU properties; RT-Smart currently uses an Sv39 VA layout. | |
| dtb="$RUNNER_TEMP/qemu-${TEST_QEMU_ARCH}-sv39.dtb" | |
| qemu-system-$TEST_QEMU_ARCH \ | |
| -M "$TEST_QEMU_MACHINE,dumpdtb=$dtb" \ | |
| -cpu rv64 \ | |
| -smp "$cpus" \ | |
| -m 256M | |
| # QEMU 6.2 recreates fw-cfg after loading an external DTB. | |
| if fdtget "$dtb" /fw-cfg@10100000 compatible >/dev/null 2>&1; then | |
| fdtput -r "$dtb" /fw-cfg@10100000 | |
| fi | |
| for ((cpu = 0; cpu < cpus; cpu++)); do | |
| fdtput -t s "$dtb" "/cpus/cpu@$cpu" mmu-type riscv,sv39 | |
| done | |
| dtb_args=(-dtb "$dtb") | |
| fi | |
| qemu-system-$TEST_QEMU_ARCH \ | |
| -nographic \ | |
| -M $TEST_QEMU_MACHINE \ | |
| -cpu rv64 \ | |
| -smp "$cpus" \ | |
| -m 256M \ | |
| -kernel "$TEST_BSP_ROOT/rtthread.bin" \ | |
| "${dtb_args[@]}" \ | |
| -append "console=ttyS0 earlycon=sbi" \ | |
| > qemu_output_$TEST_QEMU_ARCH.log 2>&1 & | |
| elif [[ "${{ matrix.platform.QEMU_ARCH }}" == "arm" ]]; then | |
| qemu-system-$TEST_QEMU_ARCH \ | |
| -nographic \ | |
| -M $TEST_QEMU_MACHINE \ | |
| -kernel $TEST_BSP_ROOT/rtthread.bin \ | |
| -sd $TEST_BSP_ROOT/sd.bin \ | |
| > qemu_output_$TEST_QEMU_ARCH.log 2>&1 & | |
| else | |
| qemu-system-$TEST_QEMU_ARCH \ | |
| -nographic \ | |
| -M $TEST_QEMU_MACHINE \ | |
| -kernel $TEST_BSP_ROOT/rtthread.bin \ | |
| > qemu_output_$TEST_QEMU_ARCH.log 2>&1 & | |
| fi | |
| if [[ "$TEST_CONFIG_FILE" != "components/dlmodule.cfg" ]]; then | |
| QEMU_PID=$! | |
| disown $QEMU_PID | |
| fi | |
| - name: Monitor qemu log | |
| if: ${{ env.TOOLCHAIN_INSTALLED != '' && success() }} | |
| # Same known-flaky qemu-virt64-riscv standard kernel utest run as the previous step. | |
| continue-on-error: ${{ matrix.platform.UTEST == 'RISCV' && (matrix.config_file == 'kernel/ipc.cfg' || matrix.config_file == 'kernel/kernel_basic.cfg') }} | |
| timeout-minutes: 360 | |
| run: | | |
| LOG_FILE="qemu_output_${TEST_QEMU_ARCH}.log" | |
| FAILURE_DETECTED=false | |
| ERROR_LOGS="" | |
| export FAILURE_DETECTED ERROR_LOGS | |
| if [[ ! -f "$LOG_FILE" ]]; then | |
| echo "Error: QEMU log file $LOG_FILE was not created." | |
| exit 1 | |
| fi | |
| echo "==========================================================================================" | |
| echo " || || " | |
| echo " || Start automatic running of Utest || " | |
| echo " VV VV " | |
| echo "==========================================================================================" | |
| set +e | |
| # Bound the QEMU wait by the loop count (20 minutes per loop). The step level | |
| # timeout-minutes cannot take an expression, so the real limit is applied here. | |
| LOOP_NUM="${UTEST_LOOP:-1}" | |
| case "$LOOP_NUM" in | |
| ''|*[!0-9]*) LOOP_NUM=1 ;; | |
| esac | |
| MONITOR_TIMEOUT_MIN=$(( LOOP_NUM * 20 )) | |
| echo "Monitoring the QEMU log for at most ${MONITOR_TIMEOUT_MIN} minutes (utest_loop=${LOOP_NUM})" | |
| timeout "${MONITOR_TIMEOUT_MIN}m" bash -c ' | |
| tail -n +1 -f "$1" | while IFS= read -r line; do | |
| echo "$line" | |
| if [[ "$line" == *"[ FAILED ] [ result ]"* ]]; then | |
| ERROR_LOGS="${ERROR_LOGS}${line}"$'\''\n'\'' | |
| FAILURE_DETECTED=true | |
| fi | |
| if [[ "${line,,}" == *"assertion failed"* || "${line,,}" == *"assert failed"* ]]; then | |
| echo "==========================================================================================" | |
| echo " || || " | |
| echo " || Error: Assertion failure detected in QEMU log. || " | |
| echo " VV VV " | |
| echo "==========================================================================================" | |
| exit 1 | |
| fi | |
| if [[ "$line" == *"[==========] [ utest ] all loops finished"* ]]; then | |
| if [[ "$FAILURE_DETECTED" == "true" ]]; then | |
| echo "==========================================================================================" | |
| echo " || || " | |
| echo " || Error: Failures detected in logs. Below are the failure details... || " | |
| echo " VV VV " | |
| echo "==========================================================================================" | |
| echo "$ERROR_LOGS" | |
| exit 1 | |
| fi | |
| echo "==========================================================================================" | |
| echo " Successed: Utest run completed. Exiting log monitoring " | |
| echo "==========================================================================================" | |
| exit 0 | |
| fi | |
| done | |
| ' bash "$LOG_FILE" | |
| monitor_status=$? | |
| set -e | |
| if [[ $monitor_status -eq 124 ]]; then | |
| echo "==========================================================================================" | |
| echo " || || " | |
| echo " || Error: Utest run timed out after ${MONITOR_TIMEOUT_MIN} minutes. Exiting... || " | |
| echo " VV VV " | |
| echo "==========================================================================================" | |
| pkill -f "qemu-system-${TEST_QEMU_ARCH}.*${TEST_BSP_ROOT}/rtthread.bin" || true | |
| exit 1 | |
| fi | |
| if [[ $monitor_status -ne 0 ]]; then | |
| pkill -f "qemu-system-${TEST_QEMU_ARCH}.*${TEST_BSP_ROOT}/rtthread.bin" || true | |
| fi | |
| exit $monitor_status | |
| - name: Verify DAC test execution | |
| if: ${{ env.TOOLCHAIN_INSTALLED != '' && matrix.config_file == 'components/dac.cfg' }} | |
| run: | | |
| testcase=components.drivers.dac.framework | |
| if ! grep -Fq "[ PASSED ] [ result ] testcase ($testcase)" qemu_output_${TEST_QEMU_ARCH}.log; then | |
| echo "Error: $testcase did not report a passing result." | |
| exit 1 | |
| fi | |
| - name: Verify I2C test execution | |
| if: ${{ env.TOOLCHAIN_INSTALLED != '' && matrix.config_file == 'components/i2c.cfg' }} | |
| run: | | |
| testcase=components.drivers.i2c.framework | |
| if ! grep -Fq "[ PASSED ] [ result ] testcase ($testcase)" qemu_output_${TEST_QEMU_ARCH}.log; then | |
| echo "Error: $testcase did not report a passing result." | |
| exit 1 | |
| fi | |
| # # Post CI status to PR comment | |
| # post-ci-status: | |
| # needs: test | |
| # if: always() && github.event_name == 'pull_request' && github.repository_owner == 'RT-Thread' | |
| # uses: ./.github/workflows/post_ci_status.yml | |
| # with: | |
| # workflow_name: "utest_auto_run" | |
| # workflow_status: ${{ needs.test.result }} | |
| # pr_number: ${{ github.event.pull_request.number }} | |
| # permissions: | |
| # pull-requests: write | |
| # issues: write |