Skip to content

ci

ci #206

Workflow file for this run

# https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
# https://docs.github.com/en/actions/guides/building-and-testing-python
name: ci
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 0 * * 0' # at 00:00 every Sunday
jobs:
tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
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: |
python -m pip install --upgrade pip
pip install "black<23" flake8 mypy pytest pytest-cov
pip freeze
- name: Install package
run: |
pip install -e .
- name: Check types
run: |
./scripts/check_types
- name: Check linter
run: |
./scripts/check_linter
- name: Check format
run: |
./scripts/check_fmt
- name: Tests
run: |
./scripts/test
- name: Upload to codecov.io
if: matrix.python-version == '3.8'
# https://github.com/codecov/codecov-action
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
deploy:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install wheel
run: pip install wheel
- name: Package
run: python setup.py sdist bdist_wheel
- name: Check output
run: ls -la dist
- name: Check deploy condition
run: |
echo "github.ref: ${{github.ref}}"
echo "github.event_name: ${{github.event_name}}"
- name: Run integration test
run: |
set -e
pip install dist/*.whl
mkdir rundir
cd rundir
echo -e "\nRunning example:"
FORCE_COLOR=3 python ../examples/example.py
- name: Publish to PyPI
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true