Skip to content

Merge pull request #113 from marcelm/rtd #486

Merge pull request #113 from marcelm/rtd

Merge pull request #113 from marcelm/rtd #486

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
lint:
# Run for PRs only if they come from a forked repo (avoids duplicate runs)
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
toxenv: [flake8, black, mypy, docs]
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 tox
run: python -m pip install tox
- name: Run tox ${{ matrix.toxenv }}
run: tox -e ${{ matrix.toxenv }}
build:
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # required for setuptools_scm
- name: Build sdist and temporary wheel
run: pipx run build
- uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*.tar.gz
test:
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
include:
- os: macos-latest
python-version: 3.8
- os: windows-latest
python-version: 3.8
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 tox
run: python -m pip install tox
- name: Test
run: tox -e py
- name: Upload coverage report
uses: codecov/codecov-action@v3
wheels:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [lint, test]
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # required for setuptools_scm
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp*-manylinux_x86_64 cp3*-win_amd64 cp3*-macosx_x86_64"
- uses: actions/upload-artifact@v2
with:
name: wheels
path: wheelhouse/*.whl
publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [build, wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: sdist
path: dist/
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist/
- name: Publish to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_password }}
#password: ${{ secrets.test_pypi_password }}
#repository_url: https://test.pypi.org/legacy/