Skip to content

docs: complete 6.2.0 changelog for post-release branch changes #414

docs: complete 6.2.0 changelog for post-release branch changes

docs: complete 6.2.0 changelog for post-release branch changes #414

Workflow file for this run

name: ci
on:
push:
branches: ["**"]
tags: ["*.*.*"]
pull_request:
branches: ["**"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
enable-cache: true
python-version: '3.14'
- name: Cache pre-commit
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: uv run --locked pre-commit run --all-files
tests:
name: Tests / ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
include:
- os: ubuntu-latest
python-version: '3.15'
experimental: true
- os: ubuntu-latest
python-version: 'pypy3.9'
- os: ubuntu-latest
python-version: 'pypy3.10'
- os: ubuntu-latest
python-version: 'pypy3.11'
continue-on-error: ${{ matrix.experimental || false }}
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --locked
- name: Run tests
if: ${{ !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14') }}
run: uv run --no-sync pytest -ra tests/
- name: Run tests with coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
run: uv run --no-sync pytest -ra --cov=persiantools --cov-report=xml tests/
- name: Run performance tests
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
env:
PERSIANTOOLS_PERF_TESTS: "1"
run: uv run --no-sync pytest -ra -s tests/test_performance.py
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
uses: codecov/codecov-action@v7
with:
files: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, tests]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
version: '0.11.17'
enable-cache: true
- name: Build sdist and wheel
run: uv build
- name: Check distribution metadata
run: uvx twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
if-no-files-found: error
publish-test-pypi:
name: Publish to Test PyPI
if: github.repository == 'majiidd/persiantools' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build]
environment: test-pypi
permissions:
contents: read
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-pypi:
name: Publish to PyPI
if: github.repository == 'majiidd/persiantools' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build, publish-test-pypi]
environment: pypi
permissions:
contents: read
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1