2021-05-10 20:34:33 +08:00
|
|
|
name: AutoTestCI
|
2021-05-10 20:38:58 +08:00
|
|
|
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2021-05-10 20:34:33 +08:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: ${{ matrix.legs.UTEST }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
legs:
|
2021-06-03 15:06:33 +08:00
|
|
|
- {UTEST: "kernel/mem", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "vexpress-a9", CONFIG_FILE: "examples/utest/configs/kernel/config.h"}
|
2021-05-10 20:34:33 +08:00
|
|
|
- {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
|
2021-06-02 09:14:59 +08:00
|
|
|
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
|
2021-05-10 20:34:33 +08:00
|
|
|
- name: Build bsp
|
|
|
|
run: |
|
2021-06-02 09:14:59 +08:00
|
|
|
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
|
2021-05-10 20:34:33 +08:00
|
|
|
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
|