Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action: add risc-v test on Ubuntu #2638

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/get_ssat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
pushd /usr/bin/
wget https://raw.githubusercontent.com/myungjoo/SSAT/main/ssat.sh
wget https://raw.githubusercontent.com/myungjoo/SSAT/main/ssat-api.sh
chmod 755 ssat*.sh
ln -s ssat.sh ssat
popd

mkdir -p /tmp/bmp2png
pushd /tmp/bmp2png
wget https://raw.githubusercontent.com/myungjoo/SSAT/main/util/bmp2png.c
wget https://raw.githubusercontent.com/myungjoo/SSAT/main/util/meson.build
meson build
ninja -C build
cp build/bmp2png /usr/bin
popd
37 changes: 37 additions & 0 deletions .github/workflows/risc-v.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test RISCV64 on Ubuntu

on:
pull_request:
branches: [ main ]

jobs:
build_job:
runs-on: ubuntu-22.04
name: Build on Ubuntu 22.04 RISC-V 64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if rebuild required
uses: ./.github/actions/check-rebuild
with:
mode: rebuild
- uses: uraimo/run-on-arch-action@v2
name: RISCV64 Run-on-arch
if: env.rebuild == '1'
id: roaa_runcmd
with:
arch: riscv64
distro: ubuntu22.04

githubToken: ${{ github.token }}

install: |
apt-get -qy update
apt-get -qy install meson ninja-build libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libglib2.0-dev libjson-glib-dev gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good libgtest-dev libpng-dev libopencv-dev python3 python3-dev python3-numpy pkg-config gcc g++ liblua5.1-dev bash wget libpng-dev libopenblas-dev cmake libiniparser-dev libjsoncpp-dev libcurl3-dev
run: |
bash .github/workflows/get_ssat.sh
meson build -Denable-test=true -Denable-tflite-backbone=false -Denable-tflite-interpreter=false -Denable-app=false
ninja -C build
pushd build && ninja test
popd
13 changes: 7 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,13 @@ if get_option('enable-app')
endif
endif

if get_option('platform') != 'android'
nnstreamer_dep = dependency('nnstreamer')
message('building nnstreamer')
subdir('nnstreamer')
else
warning('android nnstreamer-filter and nnstreamer-trainer are not yet supported, building them is skipped')
if get_option('enable-nnstreamer-tensor-filter').enabled() or get_option('enable-nnstreamer-tensor-trainer').enabled()
if get_option('platform') != 'android'
nnstreamer_dep = dependency('nnstreamer')
subdir('nnstreamer')
else
warning('android nnstreamer-filter and nnstreamer-trainer are not yet supported, building them is skipped')
endif
endif

if get_option('platform') == 'android'
Expand Down
18 changes: 11 additions & 7 deletions test/unittest/compiler/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ test_target = [
'compiler_test_util.cpp',
'unittest_compiler.cpp',
'unittest_interpreter.cpp',
'unittest_tflite_export.cpp',
'unittest_realizer.cpp',
]
test_deps = [
nntrainer_test_main_deps,
nntrainer_dep,
nntrainer_ccapi_dep,
]

if get_option('enable-tflite-interpreter') or get_option('enable-nnstreamer-tensor-filter').enabled()
test_target += 'unittest_tflite_export.cpp'
test_deps += tflite_dep
endif

exe = executable(
test_name,
test_target,
dependencies: [
nntrainer_test_main_deps,
nntrainer_dep,
nntrainer_ccapi_dep,
tflite_dep
],
dependencies: test_deps,
install: get_option('enable-test'),
install_dir: application_install_dir
)
Expand Down
Loading