Commit b7ebe7a3 authored by Yuxin Wu's avatar Yuxin Wu

add publish action

parent 79b5480d
name: Linter name: Publish to PyPI
on: [push, pull_request] on:
push:
tags:
- 'v*'
jobs: jobs:
lint: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.5, 3.6, 3.7]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python 3.7
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: ${{ matrix.python-version }} python-version: 3.7
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install flake8 pip install twine
flake8 --version - name: Build
- name: Lint run: python setup.py sdist bdist_wheel
run: |
flake8 .
- name: Lint Examples
# some examples are py3 only
if: matrix.python-version != 2.7
run: |
cd examples
flake8 .
- name: Publish
env:
TWINE_USERNAME: ppwwyyxx
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
name: Unit Tests name: CI
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
unittest: linter:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
max-parallel: 4 max-parallel: 4
matrix:
python-version: [2.7, 3.6, 3.7]
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
pip install flake8
flake8 --version
- name: Lint
run: |
flake8 .
- name: Lint Examples
# some examples are py3 only
if: matrix.python-version != 2.7
run: |
cd examples
flake8 .
unittest:
runs-on: ubuntu-latest
strategy:
max-parallel: 6
matrix: matrix:
python-version: [2.7, 3.6] python-version: [2.7, 3.6]
TF-version: [1.3.0, 1.14.0, nightly] TF-version: [1.3.0, 1.14.0, nightly]
...@@ -32,7 +60,5 @@ jobs: ...@@ -32,7 +60,5 @@ jobs:
./tests/install-tensorflow.sh ./tests/install-tensorflow.sh
python -c "import tensorflow as tf; print(tf.VERSION, tf.GIT_VERSION)" python -c "import tensorflow as tf; print(tf.VERSION, tf.GIT_VERSION)"
- name: Test - name: Run Tests
run: ./tests/run-tests.sh run: ./tests/run-tests.sh
...@@ -17,7 +17,8 @@ python -c "import tensorflow as tf; tf.Operation._add_control_input" ...@@ -17,7 +17,8 @@ python -c "import tensorflow as tf; tf.Operation._add_control_input"
python -m tensorpack.callbacks.param_test python -m tensorpack.callbacks.param_test
python -m tensorpack.tfutils.unit_tests python -m tensorpack.tfutils.unit_tests
python -m unittest tensorpack.dataflow.imgaug._test python -m unittest tensorpack.dataflow.imgaug._test
TENSORPACK_SERIALIZE=pyarrow python test_serializer.py # use pyarrow after we organize the serializers.
# TENSORPACK_SERIALIZE=pyarrow python test_serializer.py
TENSORPACK_SERIALIZE=msgpack python test_serializer.py TENSORPACK_SERIALIZE=msgpack python test_serializer.py
python -m unittest discover -v python -m unittest discover -v
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