v4.6 #141
Workflow file for this run
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
# 786 | |
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: aldy-test | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get install libgfortran4 samtools | |
python -m pip install --upgrade pip | |
python -m pip install flake8 pytest pytest-cov codecov black | |
python -m pip install setuptools wheel twine numpy cython | |
python -m pip install . | |
- name: Format with black | |
run: black aldy | |
- name: Lint with flake8 | |
run: flake8 aldy | |
- name: Run Aldy tests | |
run: | | |
mkdir -p tmp | |
cd tmp | |
aldy test | |
cd .. | |
- name: Run code coverage tests | |
run: | | |
python setup.py build_ext --inplace | |
pytest --cov=./ -v aldy | |
- name: Upload code coverage data | |
uses: codecov/codecov-action@v1 | |
- name: Build package | |
run: | | |
python setup.py sdist | |
- name: Publish on TestPyPI | |
if: matrix.python-version == '3.7' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TEST_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.python-version == '3.7' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: ${{ secrets.PYPI_USERNAME }} | |
password: ${{ secrets.PYPI_PASSWORD }} | |