-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (88 loc) · 2.82 KB
/
test.yaml
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
name: Test
on:
push:
branches:
- main
tags-ignore: ["*"]
pull_request:
branches: ["*"]
workflow_dispatch:
inputs:
logLevel:
description: Log Level
default: info
type: choice
options:
- debug
- error
- fatal
- info
- panic
- warning
environment:
description: Environment
default: test
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
dockerfile: Dockerfile.amd64-generic
tag: nntbn:amd64-generic
test: amd64-generic
- platform: linux/arm64
dockerfile: Dockerfile.arm-neon
tag: nntbn:arm64
test: arm-neon
- platform: linux/arm64
dockerfile: Dockerfile.arm-cmsis-dsp
tag: nntbn:arm64
test: arm-cmsis-dsp
- platform: linux/arm/v8
dockerfile: Dockerfile.armv8-neon
tag: nntbn:armv8-neon
test: arm-neon
- platform: linux/arm/v7
dockerfile: Dockerfile.armv7-neon
tag: nntbn:armv7-neon
test: arm-neon
steps:
- name: Docker Setup QEMU
uses: docker/[email protected]
with:
platforms: all
- name: Docker Setup Buildx
uses: docker/[email protected]
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init
- name: Create Buildx
run: |
docker buildx create --name tests --use
docker buildx inspect --bootstrap
- name: Build images
run: |
docker images
docker buildx build --platform ${{ matrix.platform }} -f scripts/docker/${{ matrix.dockerfile }} -t ${{ matrix.tag }} . --load
docker images
- name: Test
run: |
if [ "${{ matrix.test }}" == "arm-neon" ]; then
TESTS=arch/arm/neon/dot_product_perf,arch/arm/neon/neuron,arch/arm/neon/neuron_perf
elif [ "${{ matrix.test }}" == "arm-cmsis-dsp" ]; then
TESTS=arch/arm/cmsis-dsp/dot_product_perf,arch/arm/cmsis-dsp/neuron,arch/arm/cmsis-dsp/neuron_perf
elif [ "${{ matrix.test }}" == "amd64-generic" ]; then
TESTS=arch/generic/dot_product,arch/generic/dot_product_perf,arch/generic/layer,arch/generic/layer_multi,arch/generic/neuron,arch/generic/neuron_perf
else
echo "unknown test"
exit 1
fi
IFS=',' read -ra TESTS <<< "$TESTS"
for TEST in "${TESTS[@]}"; do
echo "running ${TEST}"
docker run --platform ${{ matrix.platform }} ${{ matrix.tag }} "/nn/build/tests/${TEST}"
echo " "
done