-
Notifications
You must be signed in to change notification settings - Fork 25
86 lines (73 loc) · 3.38 KB
/
RT-AK_Linux_Utest_CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: RT-AK with plugin-example CI
on: [push, pull_request]
jobs:
RT-AK-Github-Actions:
runs-on: ubuntu-latest
name: ${{ matrix.legs.UTEST }}
strategy:
fail-fast: false
matrix:
legs:
- {UTEST: "stm32/components/utest", RTT_BSP: "../AutoSTM32BSP", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9"}
- {UTEST: "riscv64/kernel/mem", RTT_BSP: "../AutoK210BSP", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt"}
env:
TEST_BSP_ROOT: ${{ matrix.legs.RTT_BSP }}
TEST_QEMU_ARCH: ${{ matrix.legs.QEMU_ARCH }}
TEST_QEMU_MACHINE: ${{ matrix.legs.QEMU_MACHINE }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.7
- name: Install dependecies
run: |
sudo apt-get -yqq install scons qemu-system git
python -m pip install --upgrade pip
pip install flake8 pytest
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install Arm ToolChains
if: ${{ matrix.legs.QEMU_ARCH == 'arm' && success() }}
run: |
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
/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
- name: Install RISC-V ToolChains
if: ${{ matrix.legs.QEMU_ARCH == 'riscv64' && success() }}
run: |
wget -q https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
sudo tar zxf 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
- name: Prepare Arm BSP
if: ${{ matrix.legs.QEMU_ARCH == 'arm' && success() }}
run: |
git clone https://github.com/Lebhoryi/QemuAutoBSP.git $TEST_BSP_ROOT
- name: Prepare RISC-V BSP
if: ${{ matrix.legs.QEMU_ARCH == 'riscv64' && success() }}
run: |
git clone https://github.com/EdgeAIWithRTT/qemu-riscv-virt64.git $TEST_BSP_ROOT
- name: Run RT-AK
run: |
pushd RT-AK/rt_ai_tools
python aitools.py --project=../../$TEST_BSP_ROOT --platform=example
popd
- name: Build BSP
run: |
scons --pyconfig-silent -C $TEST_BSP_ROOT
scons -j$(nproc) -C $TEST_BSP_ROOT
- name: Start test
if: ${{ success() }}
run: |
git clone https://github.com/EdgeAIWithRTT/UtestRunner.git
pushd UtestRunner
python3 qemu_runner.py --system $TEST_QEMU_ARCH --machine $TEST_QEMU_MACHINE --elf ../$TEST_BSP_ROOT/rtthread.elf
cat rtt_console.log
popd