Skip to content

Issue #145

Issue #145 #94

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: test-release
on:
push:
branches: [ master, ci/**]
tags: [ v* ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.9, 3.11]
pandas-version: [1, 2]
exclude:
- python-version: 3.7
pandas-version: 2
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 with pandas ${{ matrix.pandas-version }}
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install -r requirements_pandas${{ matrix.pandas-version }}.txt
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest pdtable --cov
# the test_optional_dependencies test has to be run separatelly because python imports are cached
pytest test
release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
needs: [test]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Build package
run: |
python -m pip install --upgrade pip setuptools wheel
python setup.py sdist
# the package is pure python, but let's build wheels anyway
python setup.py bdist_wheel
- name: Upload to PyPI
run: |
python -m pip install twine
python -m twine upload dist/* -u __token__ -p "$TOKEN"
env:
TOKEN: ${{ secrets.PYPI_TOKEN }}