-
Notifications
You must be signed in to change notification settings - Fork 234
78 lines (78 loc) · 2.18 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
name: CI
on:
push:
branches:
- "*"
pull_request:
branches:
- master
jobs:
test:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: macos-latest
python-version: "pypy3"
- os: windows-latest
python-version: "pypy3"
runs-on: ${{ matrix.os }}
name: "${{ matrix.os }} Python: ${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U "pip>=21.1"
pip install -U setuptools
pip install -U "tox>=3.23.0,<4" codecov tox-gh-actions coverage
- name: Log python & pip versions
run: |
python --version
pip --version
- name: Run unit tests
run: tox
- name: "Coverage report"
run: coverage xml
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v1"
with:
fail_ci_if_error: true
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -U setuptools
pip install -U "tox>=3.23.0,<4"
- run: tox -e lint
package:
name: "Build & verify package"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.8"
- name: "Install build, check-wheel-content, and twine"
run: "python -m pip install build twine check-wheel-contents"
- name: "Build package"
run: "python -m build --sdist --wheel ."
- name: "List result"
run: "ls -l dist"
- name: "Check wheel contents"
run: "check-wheel-contents dist/*.whl"
- name: "Check long_description"
run: "python -m twine check dist/*"