update #13
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: | | |
python -m pip install uv | |
python -m uv pip install --system .[dev] | |
- name: Run CLI | |
run: pinyin-to-ipa-cli | |
- name: Run linters | |
run: ruff check | |
- name: Type checking | |
run: mypy | |
- name: Run tests | |
run: pytest -n auto | |
- name: Test build | |
run: | | |
python -m build -o dist/ | |
python -m twine check dist/* | |
install-via-sdist: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: python -m pip install build pytest pytest-xdist | |
- name: Run build | |
run: python -m build -o dist/ | |
- name: Install from sdist (.tar.gz) | |
run: python -m pip install dist/*.tar.gz | |
- name: Smoke test (import) | |
run: python -c "import pinyin_to_ipa" | |
- name: Run tests | |
run: pytest -n auto |