diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..3944328 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,36 @@ +name: Python package + +on: [push, pull_request] + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install OS dependencies + run: | + sudo apt-get install -yqq python-tk scons git + - name: Install Python dependencies + run: | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f requirements.dev.txt ]; then pip install -r requirements.dev.txt; fi + - name: Install as pip package + run: | + pip install ./ -v + - name: Test installed package + working-directory: examples/auto_test + run: | + python main.py - + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9216575..0000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -language: python -python: - - "3.7" - -os: linux -dist: focal - -notifications: - email: false - -before_install: - - "sudo apt-get update || true" - -install: - # We do this conditionally because it saves us some downloading if the - # version is the same. - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi - - bash miniconda.sh -b -p $HOME/miniconda - - source "$HOME/miniconda/etc/profile.d/conda.sh" - - hash -r - - conda config --set always_yes yes --set changeps1 no - #- conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - - # Replace dep1 dep2 ... with your dependencies - - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION - - conda activate test-environment - - # dependencies - - "sudo apt-get install -qq python-tk scons git || true" - - "conda install numpy matplotlib tensorflow scikit-learn || true" - - "conda list" - -before_script: - - python --version - - python3 --version - - python2 --version - -script: - - export PYTHONPATH=`pwd`/scripts - - echo ====== New auto-test ====== - - cd examples/auto_test && python main.py - - #- mkdir -p examples/mnist-densenet/tmp - #- echo ====== local NNOM test ====== - #- cd examples/mnist-densenet && python model/mnist_densenet.py && cp -v weights.h mcu && scons && NNOM_TEST_ON_CI=YES python model/mnist_densenet.py && cd - - #- echo ====== CMSIS NN NNOM test ====== - #- cd examples/mnist-densenet && USE_CMSIS_NN=YES scons && NNOM_TEST_ON_CI=YES python model/mnist_densenet.py && cd - - -env: -- NNOM_ON_CI=YES diff --git a/requirements.dev.txt b/requirements.dev.txt new file mode 100644 index 0000000..ab6b541 --- /dev/null +++ b/requirements.dev.txt @@ -0,0 +1,4 @@ +tensorflow-cpu==2.14.1 +matplotlib +scikit-learn +numpy