Skip to content

Update ci.yml

Update ci.yml #25

Workflow file for this run

name: CI
on:
push:
branches:
- "master"
tags: ["*"]
pull_request:
branches:
- "master"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Cache PyPI
uses: actions/cache@v2
with:
key: pip-lint-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
path: ~/.cache/pip
restore-keys: |
pip-lint-
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python -m pip install -r test-requirements.txt
- name: pep8
run: |
pycodestyle --max-line-length=120 venvctrl/
pycodestyle --max-line-length=120 tests/
- name: pyflakes
run: |
pyflakes venvctrl/
pyflakes tests/
test:
name: Test
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
pyver: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: true
steps:
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y enchant-2
- name: Checkout
uses: actions/[email protected]
- name: Setup Python ${{ matrix.pyver }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- name: Cache PyPI
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.pyver }}-${{ hashFiles('test-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.pyver }}-
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python -m pip install -r test-requirements.txt
python -m pip install -e ./
- name: Run tests
env:
PYTHONPATH: .
run: py.test tests/
build-and-publish:
name: Build and publish
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pypa/build
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}