-
Notifications
You must be signed in to change notification settings - Fork 183
97 lines (80 loc) · 3.26 KB
/
compiler-test.yml
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
name: compiler-test
on: [push, pull_request]
jobs:
build:
name: build-${{matrix.config.name}}
runs-on: [self-hosted]
strategy:
matrix:
config:
- {name: x86_64-linux, shell: bash, cmakeArgs: '', buildType: Release}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Conan
run: pip install conan==1.59.0
- name: Configure Conan (Linux)
run: |
conan profile update settings.compiler.libcxx=libstdc++11 default
echo "CC=gcc-10" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
if: runner.os == 'Linux'
- name: Build
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.config.buildType}} ${{matrix.config.cmakeArgs}} -DBUILD_TESTING=ON -DPython3_ROOT_DIR=${pythonLocation}
cmake --build build --config ${{matrix.config.buildType}}
- name: Install
run: cmake --install build --prefix /tmp/nncase
- name: CTest
working-directory: ${{github.workspace}}/build/tests/kernels
run: ctest -C ${{matrix.config.buildType}}
test-compiler:
needs: [build]
name: test-${{matrix.config.name}}
runs-on: [self-hosted]
strategy:
matrix:
config:
- {name: x86_64-linux, shell: bash}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Python Packages
run: pip install -r requirements.test.txt
- name: Create Test Environment
run: mkdir test_results
- name: Test
working-directory: ${{github.workspace}}
env:
PYTHONPATH: /tmp/nncase/lib:/tmp/nncase/python:${{github.workspace}}/tests
ONNX_MODELS_DIR: /compiler/github-runner/onnx-models
TFLITE_MODELS_DIR: /compiler/github-runner/tflite-models
DATASET_DIR: /compiler/share
run: |
pytest -n 50 --dist=load tests/other --doctest-modules --junitxml=test_results/other.xml
pytest -n 50 --dist=load tests/importer --doctest-modules --junitxml=test_results/importer.xml
pytest -n 50 --dist=load tests/schedule --doctest-modules --junitxml=test_results/schedule.xml
pytest -n 50 --dist=load tests/graph_partition --doctest-modules --junitxml=test_results/graph_partition.xml
pytest -n 50 --dist=load tests/transform --doctest-modules --junitxml=test_results/transform.xml
pytest -n 8 tests/models/onnx-model-zoo --doctest-modules --junitxml=test_results/onnx-models.xml
pytest tests/examples --doctest-modules --junitxml=test_results/examples.xml
for dir in `ls dataset_tests_output`; do cat dataset_tests_output/$dir/dataset_test_result.txt; done
if: runner.os != 'Windows'
- name: Upload Test Results
uses: actions/upload-artifact@v3
with:
name: nncase-test_results-${{matrix.config.name}}
path: ${{github.workspace}}/test_results
if-no-files-found: error
- name: Upload Dataset Test Results
uses: actions/upload-artifact@v3
with:
name: nncase-dataset_test_results-${{matrix.config.name}}
path: ${{github.workspace}}/dataset_tests_output
if-no-files-found: error