add test for cf vocabulary fuzzy search #5
Workflow file for this run
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: Run unit tests and build Python package | |
on: | |
push: | |
branches: ['**'] | |
release: | |
types: [prereleased, released] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
env: | |
latest: ${{ matrix.python_version == '3.11' && 'true' || '' }} | |
strategy: | |
matrix: | |
python_version: | |
- '3.7' | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Install dependencies | |
run: | |
| | |
pip install --upgrade coveralls mock | |
pip install -e . | |
- name: Run unit tests | |
run: coverage run --omit=pythesint/tests/* --source=pythesint -m unittest discover pythesint.tests | |
- name: Publish coverage | |
if: ${{ env.latest }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: coveralls --service=github | |
build_publish_package: | |
runs-on: 'ubuntu-latest' | |
needs: tests | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3' | |
- name: Install build tools | |
run: python3 -m pip install --upgrade build | |
- name: Build Python package | |
run: python -m build | |
- name: Publish Python package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
# Storing the PyPI URL in the repositories' secrets makes | |
# publishing to the test PyPI from forks easy | |
repository_url: ${{ secrets.PYPI_REPOSITORY_URL }} | |
password: ${{ secrets.PYPI_TOKEN }} |