mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 14:50:19 +00:00
Cleanup Python project
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
name: Continuous Integration and Deployment
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: [2.7, 3.5, 3.6, 3.7]
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Setup build and test environment
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
- name: Build Python Package
|
||||
run: |
|
||||
python -m pip install ".[tests]"
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
pip install flake8
|
||||
flake8 --show-source src/ tests/
|
||||
- name: Check Manifest
|
||||
run: |
|
||||
pip install check-manifest
|
||||
check-manifest
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
coverage run --parallel -m pytest
|
||||
- name: Report code coverage
|
||||
run: |
|
||||
coverage combine
|
||||
coverage report
|
||||
coverage xml
|
||||
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Setup docs environment
|
||||
run: |
|
||||
python -m pip install ".[docs]"
|
||||
- name: Build documentation with sphinx
|
||||
run: |
|
||||
sphinx-build -W -b html -d doctrees docs/source docs/_build/html
|
||||
|
||||
publish:
|
||||
needs: [build, docs]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python 3.7
|
||||
if: startsWith(github.event.ref, 'refs/tags')
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Build Package
|
||||
if: startsWith(github.event.ref, 'refs/tags')
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
python setup.py sdist bdist_wheel --universal
|
||||
- name: Publish Package on PyPI
|
||||
if: startsWith(github.event.ref, 'refs/tags')
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.pypi_token }}
|
||||
@@ -0,0 +1,18 @@
|
||||
name: "Close Stale Issues and Pull Requests"
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 * * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 60
|
||||
days-before-close: 7
|
||||
stale-issue-label: stale
|
||||
stale-pr-label: state
|
||||
stale-issue-message: 'This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
|
||||
stale-pr-message: 'This Pull Request is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
|
||||
Reference in New Issue
Block a user