Commit 79b5480d authored by Yuxin Wu's avatar Yuxin Wu

add unittest to actions

parent 38b38fe1
name: Unit Tests
on: [push, pull_request]
jobs:
unittest:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.6]
TF-version: [1.3.0, 1.14.0, nightly]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install scikit-image opencv-python lmdb h5py pyarrow
python -m pip install .
python -c "import tensorpack.dataflow"
# check that dataflow can be imported alone without tensorflow
python -c "import cv2; print('OpenCV '+ cv2.__version__)"
- name: Install TF
env:
TF_VERSION: ${{ matrix.TF-version }}
# compatible with travis scripts
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
run: |
./tests/install-tensorflow.sh
python -c "import tensorflow as tf; print(tf.VERSION, tf.GIT_VERSION)"
- name: Test
run: ./tests/run-tests.sh
......@@ -20,24 +20,24 @@ matrix:
include:
- os: linux
python: 2.7
env: TF_VERSION=1.3.0 TF_TYPE=release
env: TF_VERSION=1.3.0
- os: linux
python: 3.6
env: TF_VERSION=1.3.0 TF_TYPE=release
env: TF_VERSION=1.3.0
- os: linux
python: 2.7
env: TF_VERSION=1.14.0 TF_TYPE=release
env: TF_VERSION=1.14.0
- os: linux
python: 3.6
env: TF_VERSION=1.14.0 TF_TYPE=release PYPI=true
env: TF_VERSION=1.14.0 PYPI=true
- os: linux
python: 2.7
env: TF_TYPE=nightly
env: TF_VERSION=nightly
- os: linux
python: 3.6
env: TF_TYPE=nightly
env: TF_VERSION=nightly
allow_failures:
- env: TF_TYPE=nightly
- env: TF_VERSION=nightly
install:
- pip install -U pip # the pip version on travis is too old
......
#!/bin/bash -e
if [ $TF_TYPE == "release" ]; then
if [ $TF_VERSION == "nightly" ]; then
TF_BINARY_URL="tf-nightly"
else
if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then
TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-${TF_VERSION}-cp27-none-linux_x86_64.whl
fi
......@@ -14,9 +16,6 @@ if [ $TF_TYPE == "release" ]; then
TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-${TF_VERSION}-cp36-cp36m-linux_x86_64.whl
fi
fi
if [ $TF_TYPE == "nightly" ]; then
TF_BINARY_URL="tf-nightly"
fi
pip install --upgrade ${TF_BINARY_URL}
python -m pip install --upgrade ${TF_BINARY_URL}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment