[ci] add github action

This commit is contained in:
朱天龙 (Armink) 2023-04-21 17:42:09 +08:00 committed by GitHub
parent 9817307026
commit fcff17f53d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 0 deletions

33
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: AutoTestCI
on: push
jobs:
test:
name: AutoTest
runs-on: ubuntu-latest
env:
TEST_BSP_ROOT: ../AutoTestBsp
UTEST_RUNNER_PATH: ../UtestRunner
steps:
- uses: actions/checkout@v1
- name: Prepare env
run: |
sudo apt-get update
sudo apt-get -yqq install scons qemu-system git
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/arm-2017q2-v6/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
sudo tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -C /opt
export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-6-2017-q2-update/bin
git clone https://github.com/armink/UtestRunner.git $UTEST_RUNNER_PATH
git clone https://github.com/armink/FlashDBAutoTestBSP.git $TEST_BSP_ROOT
- name: Build bsp
run: |
cp -rf src/* $TEST_BSP_ROOT/packages/FlashDB/src
cp -rf tests/* $TEST_BSP_ROOT/packages/FlashDB/tests
cp -rf inc/fdb_def.h $TEST_BSP_ROOT/packages/FlashDB/inc/fdb_def.h
cp -rf inc/fdb_low_lvl.h $TEST_BSP_ROOT/packages/FlashDB/inc/fdb_low_lvl.h
cp -rf inc/flashdb.h $TEST_BSP_ROOT/packages/FlashDB/inc/flashdb.h
/opt/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc --version
scons -j$(nproc) -C $TEST_BSP_ROOT
- name: Start test
run: |
python3 qemu_runner.py --elf $TEST_BSP_ROOT/rtthread.elf --sd $TEST_BSP_ROOT/sd.bin
cat rtt_console.log