-
Notifications
You must be signed in to change notification settings - Fork 16
81 lines (75 loc) · 2.85 KB
/
test_build_api.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
# 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 Build API
on:
push:
branches: ["main", "canary"]
pull_request:
branches: ["main", "canary"]
permissions:
contents: read
jobs:
build-the-build-api:
env:
TURNKEY_DEBUG: True
TURNKEY_TRACEBACK: True
strategy:
matrix:
python-version: ["3.8", "3.10"]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Miniconda with 64-bit Python
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: tkml
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
conda install pylint
pip install -e .[tensorflow] --no-cache-dir
pip install transformers
python -m pip check
- name: Lint with PyLint
shell: bash -el {0}
run: |
pylint src/turnkeyml/build --rcfile .pylintrc
pylint examples/build_api --rcfile .pylintrc
- name: Test with unittest
shell: bash -el {0}
run: |
# build api examples
# Note: we clear the default cache location prior to each example run
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/hello_torch_world.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/hello_keras_world.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/hello_onnx_world.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/randomforest.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/xgbclassifier.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/lgbmclassifier.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/kneighborsclassifier.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/build_name.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/cache_dir.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/no_monitor.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/rebuild_always.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/rebuild_never.py
rm -rf ~/.cache/turnkey_test_cache
python examples/build_api/sequence.py
# build api tests
python test/build_model.py