Parse raw sentences for custom tags, fix: https://github.com/hankcs/H… #238
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
push: | |
branches: [ "**" ] | |
pull_request: | |
branches: [ "**" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
env: | |
HANLP_HOME: ${{ github.workspace }}/data | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: [ 3.6, 3.7, 3.8, 3.9, '3.10' ] | |
exclude: | |
# GHA doesn't list 3.6 for ubuntu-22.04 | |
- os: ubuntu-latest | |
python-version: "3.6" | |
# MacOS 14.4.1 for arm64 doesn't support Python < 3.8 | |
- os: macos-latest | |
python-version: "3.6" | |
- os: macos-latest | |
python-version: "3.7" | |
include: | |
# GHA doesn't list 3.6 for ubuntu-22 | |
- os: ubuntu-20.04 | |
python-version: "3.6" | |
# MacOS 13 required for Python < 3.8 | |
- os: macos-13 | |
python-version: "3.6" | |
- os: macos-13 | |
python-version: "3.7" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
shell: bash | |
run: | | |
python -m pip install -e plugins/hanlp_trie | |
python -m pip install -e plugins/hanlp_common | |
python -m pip install -e . | |
python -m pip install pytest | |
- name: Cache data | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HANLP_HOME }} | |
key: hanlp-data | |
- name: Test with pytest | |
shell: bash | |
run: | | |
pytest tests | |
pytest plugins/hanlp_trie/tests | |
deploy: | |
needs: build | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install setuptools wheel twine | |
- name: Deploy to PyPI | |
run: | | |
python setup.py sdist bdist_wheel | |
python -m twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
TWINE_REPOSITORY: pypi |