[pre-commit.ci] auto fixes from pre-commit.com hooks #201
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push] | |
jobs: | |
code: | |
name: Code | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
task: [flake8, black, isort] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install tox | |
- name: Run task | |
run: tox -e ${{ matrix.task }} | |
manifest: | |
name: Check Manifest | |
needs: code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install check-manifest | |
- name: Check Manifest | |
run: check-manifest | |
test: | |
needs: code | |
name: ${{ matrix.platform }} py${{ matrix.python }} ${{ matrix.toxenv }} | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest, windows-latest, macos-latest] | |
python: [3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install setuptools tox tox-gh-actions | |
# here we pass off control of environment creation and running of tests to tox | |
# tox-gh-actions, installed above, helps to convert environment variables into | |
# tox "factors" ... limiting the scope of what gets tested on each platform | |
# The one exception is if the "toxenv" environment variable has been set, | |
# in which case we are declaring one specific tox environment to run. | |
# see tox.ini for more | |
- name: Test with tox | |
run: tox | |
env: | |
PLATFORM: ${{ matrix.platform }} | |
TOXENV: ${{ matrix.toxenv }} | |
# test_pip_install: | |
# name: ubuntu-latest 3.8 pip install | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Set up Python 3.8 | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.8 | |
# | |
# - name: Install this commit | |
# run: | | |
# # pip install this git sha directly from github | |
# pip install --upgrade pip | |
# pip install git+git://github.com/${{ github.repository }}.git@${{ github.sha }}#egg=msalign[testing] | |
# | |
# - name: Test | |
# run: pytest --pyargs msalign --color=yes | |
coverage: | |
name: "Coverage" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install ".[testing]" | |
- name: Test with pytest | |
run: | | |
pytest --cov=msalign | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
install-dev: | |
strategy: | |
max-parallel: 4 | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
name: "Verify installation on ${{ matrix.os }}." | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- uses: "actions/checkout@v2" | |
- uses: "actions/setup-python@v1" | |
with: | |
python-version: "3.7" | |
- name: Install | |
run: | | |
pip install -e . | |
python -c 'import msalign; print(msalign.__version__)' | |
deploy: | |
needs: [test] | |
name: "Deploy" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip # || pip3 install --upgrade pip | |
pip install ".[deploy]" | |
- name: Build package | |
run: | | |
python setup.py sdist bdist_wheel --universal | |
- name: Publish to Test PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_test_password }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |