Skip to content

test: fix canary testing #352

test: fix canary testing

test: fix canary testing #352

Workflow file for this run

---
name: CI
"on":
push:
branches: [main]
tags: [v*]
pull_request: null
jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14
- uses: j178/prek-action@v1
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.14"]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- name: Install uv and Python
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- name: Install Package
run: uv pip install ".[test]"
- name: Run pytest
run: pytest --cov
prek-hook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv and Python
uses: astral-sh/setup-uv@v7
with:
python-version: 3.14
activate-environment: true
- name: Install prek
uses: j178/prek-action@v1
with:
install-only: true
- name: Install Package
run: uv pip install ".[test]"
- name: run prek with plugin
run: prek run --config .pre-commit-test.yaml --all-files --verbose --show-diff-on-failure
publish:
name: Publish to PyPi
needs: [prek, tests, prek-hook]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mdformat-mkdocs
permissions:
contents: write # For GitHub release creation
id-token: write # IMPORTANT: mandatory for PyPI trusted publishing
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Install uv and Python
uses: astral-sh/setup-uv@v7
with:
python-version: 3.14
- name: Build Package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Generate changelog with commitizen
id: changelog
run: |
uv tool install commitizen
VERSION="${GITHUB_REF_NAME#v}"
CHANGELOG=$(cz changelog "$VERSION" --dry-run)
PREV_TAG=$(git describe --tags --abbrev=0 "$GITHUB_REF^" 2>/dev/null || echo "")
{
echo 'body<<EOF'
echo "$CHANGELOG"
if [ -n "$PREV_TAG" ]; then
echo ""
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${GITHUB_REF_NAME}"
fi
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Generate GitHub Release Notes
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.body }}