-
Notifications
You must be signed in to change notification settings - Fork 179
142 lines (129 loc) · 3.99 KB
/
run-onert-cross-build.yml
File metadata and controls
142 lines (129 loc) · 3.99 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Run ONERT Ubuntu Cross Build
on:
push:
branches:
- master
- release/*
paths:
- '.github/workflows/run-onert-build.yml'
- 'nn*'
- 'Makefile.template'
- 'infra/buildtool/**'
- 'infra/cmake/**'
- 'infra/nncc/**'
- 'infra/nnfw/**'
- 'runtime/**'
- '!runtime/contrib/**'
- '!**/*.md'
pull_request:
branches:
- master
- release/*
paths:
- '.github/workflows/run-onert-build.yml'
- 'nn*'
- 'Makefile.template'
- 'infra/buildtool/**'
- 'infra/cmake/**'
- 'infra/nncc/**'
- 'infra/nnfw/**'
- 'runtime/**'
- '!runtime/contrib/**'
- '!**/*.md'
defaults:
run:
shell: bash
# Cancel previous running jobs when pull request is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
if: github.repository_owner == 'Samsung'
strategy:
# Debug build test on ubuntu arm32 only
matrix:
type: [ debug, release ]
ubuntu_code: [ jammy ]
arch: [ armv7l ]
include:
- arch: armv7l
platform: arm
runs-on: one-x64-linux
container:
image: nnfw/one-devtools:${{ matrix.ubuntu_code }}-cross
options: --user root
env:
TARGET_ARCH: ${{ matrix.arch }}
BUILD_TYPE: ${{ matrix.type }}
CROSS_BUILD: 1
OPTIONS: "-DBUILD_ARMCOMPUTE=OFF" # Disable arm compute library
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Caching externals
uses: actions/cache@v4
with:
path: externals
key: external-onert-${{ matrix.ubuntu_code }}-${{ hashFiles('infra/cmake/packages/**/*.cmake') }}-${{ hashFiles('infra/nnfw/cmake/packages/**/*.cmake') }}
restore-keys: |
external-onert-${{ matrix.ubuntu_code }}-
external-onert-
external-
- name: Download rootfs for cross build
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
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 create-testsuite
- 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: [ jammy ]
arch: [ armv7l ]
include:
- arch: armv7l
platform: linux/arm/v7
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