Initial bringup of TKML #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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", "development"] | |
pull_request: | |
branches: ["main", "development"] | |
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 toolchain[tensorflow] --no-cache-dir | |
pip install transformers | |
python -m pip check | |
- name: Lint with PyLint | |
shell: bash -el {0} | |
run: | | |
pylint toolchain/src/turnkeyml/build --rcfile toolchain/.pylintrc | |
pylint toolchain/examples/build_api --rcfile toolchain/.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 toolchain/examples/build_api/hello_torch_world.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/hello_keras_world.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/hello_onnx_world.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/randomforest.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/xgbclassifier.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/lgbmclassifier.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/kneighborsclassifier.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/build_name.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/cache_dir.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/no_monitor.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/rebuild_always.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/rebuild_never.py | |
rm -rf ~/.cache/turnkey_test_cache | |
python toolchain/examples/build_api/sequence.py | |
# build api tests | |
python toolchain/test/build_model.py |