Skip to content

Test on ubuntu-latest, macos-latest, windows-latest #224

Test on ubuntu-latest, macos-latest, windows-latest

Test on ubuntu-latest, macos-latest, windows-latest #224

Workflow file for this run

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:

Check failure on line 20 in .github/workflows/unit-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/unit-tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 20
- os: ubuntu-latest
python-version: "3.6"
- os: macos-latest
python-version: "3.6"
- os: macos-latest
python-version: "3.7"
include:
- os: ubuntu-20.04
python-version: "3.6"
- 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: Cache dependencies
id: cache-pip
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
- if: ${{ steps.cache-pip.outputs.cache-hit != 'true' }}
name: Install dependencies
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
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