Skip to content

[pre-commit.ci] pre-commit autoupdate #62

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #62

Workflow file for this run

name: test
on:
push:
branches:
- main
tags:
- "[0-9]+.[0-9]+(.[0-9]+)?"
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
test:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install hatch
run: pipx install hatch
- name: Run tests
run: hatch run cov
publish:
runs-on: ubuntu-latest
needs:
- test
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Build a binary wheel and a source tarball
run: pipx run build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}