diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a7e29fc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: CI +on: + workflow_dispatch: + push: + release: + types: + - published + +jobs: + dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install wheel and SDist requirements + run: python -m pip install "setuptools>=42.0" wheel + + - name: Build packages + run: python setup.py sdist bdist_wheel + + - uses: actions/upload-artifact@v3 + with: + path: | + dist/*.tar.gz + dist/*.whl + + test: + name: Run tests on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-18.04, windows-latest, macos-latest] + python-version: ["3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + - uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + + - name: Install package and dependencies + run: | + python -m pip install -e . + python -m pip install -r requirements_dev.txt + + - name: Run pytest + run: pytest + working-directory: tests + + publish: + needs: [dist, test] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/.gitignore b/.gitignore index 139841b..bc0c93e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,10 @@ __pycache__/ # C extensions *.so +# Virtualenvs +venv/ +.venv/ + # Distribution / packaging .Python env/ diff --git a/tox.ini b/tox.ini index 1cc5235..42bc6d8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py36, py37, py38, py39, flake8 +envlist = py37, py38, py39, py310, flake8 [testenv:flake8] basepython=python