Skip to content

ci: run workflow on pull requests #61

ci: run workflow on pull requests

ci: run workflow on pull requests #61

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Tox
run: pip install tox
- name: Run ruff formatter
run: tox -e ruff-format
- name: Run ruff
run: tox -e ruff
- name: Run mypy
run: tox -e mypy
- name: Run pytest (Conan v1)
run: tox -e py-v1
- name: Run pytest (Conan v2)
run: tox -e py-v2
- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12'
run: tox -e coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: test # only run if previous job was successful
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a source tarball
run: python -m build --outdir dist/ .
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}