Skip to content

Merge fork from cleanup (#1) #2

Merge fork from cleanup (#1)

Merge fork from cleanup (#1) #2

# 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