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

[infra/github] Add arm32/64 onert test #14550

Merged
merged 1 commit into from
Jan 16, 2025
Merged
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
83 changes: 80 additions & 3 deletions .github/workflows/run-onert-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,28 @@ jobs:
build:
if: github.repository_owner == 'Samsung'
strategy:
# Debug build test on ubuntu 20.04 only
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a question, why do you exclude debug build test on 22.04?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce overhead by too many runner (2 debug/release x 2 OS version x 3 arch = 12 runners), and too big artifact size (release: 35MB x 6, debug: 300MB x 6) for 1 PR at once.

matrix:
type: [ debug, release ]
ubuntu_code: [ focal, jammy ] # TODO: noble
arch: [ x86_64 ] # TODO: armv7l, aarch64
arch: [ x86_64, armv7l, aarch64 ]
include:
- arch: armv7l
platform: arm
- arch: aarch64
platform: aarch64
exclude:
- ubuntu_code: jammy
type: debug
runs-on: ubuntu-22.04
container:
image: nnfw/one-devtools:${{ matrix.ubuntu_code }}
options: --user root
env:
TARGET_ARCH: ${{ matrix.arch }}
BUILD_TYPE: ${{ matrix.type }}
CROSS_BUILD: ${{ matrix.arch != 'x86_64' && '1' || '0' }}
OPTIONS: "-DBUILD_ARMCOMPUTE=OFF" # Disable arm compute library
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -67,11 +78,77 @@ jobs:
external-onert-
external-

- name: Download rootfs for cross build
if: matrix.arch != 'x86_64'
uses: dawidd6/action-download-artifact@v7
with:
workflow: generate-rootfs.yml
branch: master
name: rootfs_${{ matrix.platform }}_${{ matrix.ubuntu_code }}

# Workaround: symlink for rootfs checker in cmake toolchain file
- name: Install rootfs for cross build
if: matrix.arch != 'x86_64'
run: |
mkdir -p tools/cross/rootfs
tar -zxf rootfs_${{ matrix.platform }}_${{ matrix.ubuntu_code }}.tar.gz -C tools/cross/rootfs
pushd tools/cross/rootfs/${{ matrix.platform }}
ln -sf usr/lib lib
popd

- name: Build onert
run: |
make -f Makefile.template
make -f Makefile.template create-testsuite

- name: Run test
- name: Run test on native build
if: matrix.arch == 'x86_64'
run: |
./Product/out/test/onert-test unittest
./Product/out/test/onert-test unittest --unittestdir=./Product/out/nnapi-gtest

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: matrix.type == 'release'
with:
name: onert-${{ matrix.arch }}-${{ matrix.ubuntu_code }}
path: Product/out/test-suite.tar.gz
retention-days: ${{ github.event_name == 'pull_request' && '3' || '7' }}

test_cross:
if: github.repository_owner == 'Samsung'
needs: build
runs-on: ubuntu-22.04
strategy:
matrix:
ubuntu_code: [ focal, jammy ] # TODO: noble
arch: [ armv7l, aarch64 ]
include:
- arch: armv7l
platform: linux/arm/v7
- arch: aarch64
platform: linux/arm64
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: onert-${{ matrix.arch }}-${{ matrix.ubuntu_code }}

- name: Unzip artifacts
run: |
tar -xvf test-suite.tar.gz

- name: QEMU for cross build
uses: docker/setup-qemu-action@v3

- name: Run test on cross build
uses: addnab/docker-run-action@v3
with:
image: ubuntu:${{ matrix.ubuntu_code }}
shell: bash
options: |
--platform ${{ matrix.platform }}
-v ${{ github.workspace }}:/work -w /work
run: |
set -eo pipefail
./Product/out/test/onert-test unittest
./Product/out/test/onert-test unittest --unittestdir=./Product/out/nnapi-gtest