-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (60 loc) · 2.11 KB
/
test_onnxflow.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Lint and Test onnxflow
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
env:
MLAGILITY_DEBUG: True
MLAGILITY_TRACEBACK: True
strategy:
matrix:
python-version: ["3.8", "3.10"]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: mla
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
conda install pylint
if [ -f setup.py ]; then pip install -e .[tensorflow]; fi
pip install transformers
python -m pip check
- name: Lint with PyLint
shell: bash -el {0}
run: |
pylint src/onnxflow --rcfile .pylintrc
pylint examples/onnxflow --rcfile .pylintrc
- name: Test with unittest
shell: bash -el {0}
run: |
# onnxflow examples
rm -rf ~/.cache/onnxflow_test_cache
python examples/onnxflow/hello_torch_world.py
rm -rf ~/.cache/onnxflow_test_cache
python examples/onnxflow/hello_keras_world.py
rm -rf ~/.cache/onnxflow_test_cache
python examples/onnxflow/hello_onnx_world.py
rm -rf ~/.cache/onnxflow_test_cache
python examples/onnxflow/randomforest.py
rm -rf ~/.cache/onnxflow_test_cache
python examples/onnxflow/xgbclassifier.py
rm -rf ~/.cache/onnxflow_test_cache
python examples/onnxflow/lgbmclassifier.py
rm -rf ~/.cache/onnxflow_test_cache
python examples/onnxflow/kneighborsclassifier.py
# onnxflow tests
rm -rf ~/.cache/onnxflow_test_cache
python test/build_model.py