@@ -27,14 +27,45 @@ jobs:
2727 - name : Install dependencies
2828 run : |
2929 python -m pip install --upgrade pip
30+ python -m pip install -e plugins/hanlp_trie
31+ python -m pip install -e plugins/hanlp_common
32+ python -m pip install -e plugins/hanlp_restful
33+ python -m pip install -e .
3034 python -m pip install flake8 pytest
3135 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32- - name : Lint with flake8
33- run : |
34- # stop the build if there are Python syntax errors or undefined names
35- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+ # - name: Lint with flake8
37+ # run: |
38+ # # stop the build if there are Python syntax errors or undefined names
39+ # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40+ # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41+ # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42+ # - name: Set environment variables
43+ # run: |
44+ # echo "PYTHONPATH=.:plugins/hanlp_trie:plugins/hanlp_common:plugins/hanlp_restful" >> $GITHUB_ENV
3845 - name : Test with pytest
3946 run : |
40- pytest
47+ pytest tests
48+ pytest plugins/hanlp_trie/tests
49+ deploy :
50+ needs : build
51+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
52+ runs-on : ubuntu-latest
53+
54+ steps :
55+ - uses : actions/checkout@v2
56+ # - name: Set up Python 3.7
57+ # uses: actions/setup-python@v2
58+ # with:
59+ # python-version: 3.7
60+ - name : Install dependencies
61+ run : |
62+ python -m pip install --upgrade pip
63+ python -m pip install setuptools wheel twine
64+ - name : Deploy to PyPI
65+ run : |
66+ python setup.py sdist bdist_wheel
67+ python -m twine upload dist/*
68+ env :
69+ TWINE_USERNAME : __token__
70+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
71+ TWINE_REPOSITORY : pypi
0 commit comments