Skip to content

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

[pre-commit.ci] pre-commit autoupdate

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

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: false
matrix:
include:
- os: ubuntu-latest
python-version: "3.7"
- os: ubuntu-latest
python-version: "3.8"
- os: ubuntu-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.7"
- os: windows-latest
python-version: "3.12"
- os: macos-12
python-version: "3.7"
- os: macos-latest
python-version: "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 }}