-
Notifications
You must be signed in to change notification settings - Fork 9
94 lines (93 loc) · 2.68 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches:
- "master"
tags: ["*"]
pull_request:
branches:
- "master"
workflow_dispatch: {}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- 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.9", "3.10", "3.11", "3.12", "3.13"]
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.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- 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 }}