-
Notifications
You must be signed in to change notification settings - Fork 178
122 lines (111 loc) · 3.81 KB
/
run-onert-native-build.yml
File metadata and controls
122 lines (111 loc) · 3.81 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
name: Run ONERT Ubuntu Native Build
on:
push:
branches:
- master
- release/*
paths:
- '.github/workflows/run-onert-native-build.yml'
- 'nnfw'
- 'Makefile.template'
- 'runtime/**'
- '!runtime/contrib/**'
- '!runtime/infra/debian/**'
- '!runtime/infra/gbs/**'
- '!runtime/infra/python/**'
- '!**/*.md'
pull_request:
branches:
- master
- release/*
paths:
- '.github/workflows/run-onert-native-build.yml'
- 'nnfw'
- 'Makefile.template'
- 'runtime/**'
- '!runtime/contrib/**'
- '!runtime/infra/debian/**'
- '!runtime/infra/gbs/**'
- '!runtime/infra/python/**'
- '!**/*.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:
# Release build test only on non arm32 platforms
matrix:
type: [ release ]
ubuntu_code: [ jammy ]
arch: [ x86_64, aarch64 ]
include:
- arch: x86_64
runner: one-x64-linux
- arch: aarch64
runner: one-arm-linux
runs-on: ${{ matrix.runner }}
container:
# Use test image: default image is not supporting arm64 yet
image: samsungonedev.azurecr.io/nnfw/one-devtools:${{ matrix.ubuntu_code }}
options: --user root
env:
TARGET_ARCH: ${{ matrix.arch }}
BUILD_TYPE: ${{ matrix.type }}
OPTIONS: "-DBUILD_ARMCOMPUTE=OFF" # Disable arm compute library
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore onecc external cache
uses: actions/cache/restore@v4
with:
path: externals
key: external-onecc-${{ hashFiles('infra/cmake/packages/**/*.cmake') }}
restore-keys: |
external-onecc-
- name: Restore externals cache
uses: actions/cache/restore@v4
id: external-cache
with:
path: runtime/externals
key: external-onert-${{ matrix.ubuntu_code }}-${{ hashFiles('runtime/infra/cmake/packages/**/*.cmake') }}
restore-keys: |
external-onert-${{ matrix.ubuntu_code }}-
- name: Get month for ccache cache key
id: get-month
run: echo "key_month=$(date +%y%m)" >> "$GITHUB_OUTPUT"
- name: Restore ccache cache
uses: actions/cache/restore@v4
id: ccache-cache
with:
path: ~/.cache/ccache
key: ccache-onert-${{ matrix.ubuntu_code }}-${{ matrix.arch }}-${{ matrix.type }}-${{ steps.get-month.outputs.key_month }}
restore-keys: |
ccache-onert-${{ matrix.ubuntu_code }}-${{ matrix.arch }}-${{ matrix.type }}
- name: Build onert
run: |
make -f Makefile.template
- name: Run test on native
run: |
./Product/out/test/onert-test unittest
./Product/out/test/onert-test unittest --unittestdir=./Product/out/nnapi-gtest
# Save cache on push to reduce the size of cache storage
# ccache cache: only for master branch
# externals cache: only for master branch and Release build and x86_64
- name: Save ccache cache
uses: actions/cache/save@v4
if: github.event_name == 'push' && github.ref_name =='master'
with:
path: ~/.cache/ccache
key: ${{ steps.ccache-cache.outputs.cache-primary-key }}
- name: Save externals cache
uses: actions/cache/save@v4
if: github.event_name == 'push' && github.ref_name =='master' && matrix.type =='release' && matrix.arch == 'x86_64'
with:
path: runtime/externals
key: ${{ steps.external-cache.outputs.cache-primary-key }}