Fix CI #164
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.11', '3.12'] | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
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/[email protected] | |
- 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: | |
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.10.3 | |
with: | |
verbose: true | |