Tooling update #62
Workflow file for this run
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 | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
name: Lint and test on ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Linux py38 | |
pyversion: '3.8' | |
- name: Linux py39 | |
pyversion: '3.9' | |
- name: Linux py310 | |
pyversion: '3.10' | |
- name: Linux py311 | |
pyversion: '3.11' | |
- name: Linux py312 | |
pyversion: '3.12' | |
- name: Linux py313 | |
pyversion: '3.13' | |
- name: Linux py314 | |
pyversion: '3.14' | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Set up Python ${{ matrix.pyversion }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
- name: Install dependencies | |
run: uv sync | |
- name: Lint | |
run: uv run ruff check | |
- name: Format | |
run: uv run ruff format --check | |
- name: Test | |
run: uv run pytest -v --cov=patchdiff --cov-report=term-missing | |
build: | |
name: Build and test wheel | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: uv sync | |
- name: Build wheel | |
run: uv build | |
- name: Twine check | |
run: uvx twine check dist/* | |
- name: Upload wheel artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: dist | |
name: dist | |
publish: | |
name: Publish to Github and Pypi | |
runs-on: ubuntu-latest | |
needs: [test, build] | |
if: success() && startsWith(github.ref, 'refs/tags/v') | |
environment: | |
name: pypi | |
url: https://pypi.org/p/patchdiff | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Download wheel artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
dist/*.tar.gz | |
dist/*.whl | |
draft: true | |
prerelease: false | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |