Skip to content

Merge pull request #31 from EmbeddedCamerata/ospp #34

Merge pull request #31 from EmbeddedCamerata/ospp

Merge pull request #31 from EmbeddedCamerata/ospp #34

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