Skip to content

Feature/auto select qtmtd #1482

Feature/auto select qtmtd

Feature/auto select qtmtd #1482

Workflow file for this run

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