action_utest.yml 1.7 KB
Newer Older
G
guozhanxin 已提交
1
name: AutoTestCI
G
guozhanxin 已提交
2 3 4 5

# Controls when the action will run. Triggers the workflow on push or pull request
on: [push, pull_request]

G
guozhanxin 已提交
6 7 8 9 10 11 12 13
jobs:
  test:
    runs-on: ubuntu-latest
    name: ${{ matrix.legs.UTEST }}
    strategy:
      fail-fast: false
      matrix:
       legs:
G
guozhanxin 已提交
14
         - {UTEST: "kernel/mem",       RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "vexpress-a9", CONFIG_FILE: "examples/utest/configs/kernel/config.h"}
G
guozhanxin 已提交
15 16 17 18 19 20 21 22 23 24 25
         - {UTEST: "components/utest", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "vexpress-a9", CONFIG_FILE: "examples/utest/configs/utest_self/config.h"}
    
    env:
      TEST_BSP_ROOT: ${{ matrix.legs.RTT_BSP }}
      TEST_CONFIG_FILE: ${{ matrix.legs.CONFIG_FILE }}
    steps:
    - uses: actions/checkout@v1
    - name: Prepare env
      run: |
        sudo apt-get update > /dev/null
        sudo apt-get -yqq install scons qemu-system-arm git
26 27
        wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/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
G
guozhanxin 已提交
28 29
    - name: Build bsp
      run: |
30 31
        export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin
        /opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
G
guozhanxin 已提交
32 33 34 35 36 37 38 39 40 41 42 43
        cp $TEST_CONFIG_FILE $TEST_BSP_ROOT/rtconfig.h
        scons -j$(nproc) -C $TEST_BSP_ROOT
    - name: Start test
      run: |
        git clone https://github.com/armink/UtestRunner.git
        pushd $TEST_BSP_ROOT
        dd if=/dev/zero of=sd.bin bs=1024 count=65536
        popd
        pushd UtestRunner
        python3 qemu_runner.py --elf ../$TEST_BSP_ROOT/rtthread.elf --sd ../$TEST_BSP_ROOT/sd.bin
        cat rtt_console.log
        popd