-
Notifications
You must be signed in to change notification settings - Fork 6
127 lines (103 loc) · 3.43 KB
/
main.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: main
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install OS package dependencies
run: |
sudo apt update
sudo apt install libenchant-2-dev libbz2-dev libsnappy-dev libunwind-dev libgirepository1.0-dev
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
architecture: 'x64'
- name: Install Python development packages
run: |
python -m pip install -U pip
pip install -U -r requirements-dev.txt
- name: Install Python package
run: |
pip install -U --force-reinstall -r requirements-latest.txt
pip install .
- name: Run Flake8
run: tox -c tox.ini -e flake8
- name: Run Yapf
run: tox -c tox.ini -e yapf
- name: Run MyPy
run: tox -c tox.ini -e mypy
test:
# Test on Ubuntu, MacOS, Windows using CPython 3.6-3.9, PyPy 3.6-3.7
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
# os: [ubuntu-22.04, macos-latest, windows-latest]
# https://github.com/actions/setup-python#specifying-a-pypy-version
python-version: ['3.9', '3.11', 'pypy-3.9']
# https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
continue-on-error: false
steps:
# Checkout sources
- uses: actions/checkout@v3
# Install OS packages, as we install Python packages from source:
#
# libenchant-dev needed for pyenchant, needed for sphinx-spellcheck
# libbz2-dev, libsnappy-dev needed for compression
# libunwind-dev needed for vmprof
#
- name: Install OS package dependencies
run: |
sudo apt update
sudo apt install build-essential libssl-dev libffi-dev libunwind-dev \
libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
libsnappy-dev libgirepository1.0-dev
# Use this Python
# https://github.com/actions/setup-python/blob/main/README.md
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python development packages
run: |
python -m pip install -U pip
pip install -U -r requirements-dev.txt
- name: Install Python package
run: |
pip install -r ./requirements.txt
pip install .
- name: Run unit tests (PyTest)
run: |
tox -c tox.ini -e pytest
docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install OS package dependencies
run: |
sudo apt update
sudo apt install libenchant-2-dev libbz2-dev libsnappy-dev libunwind-dev libgirepository1.0-dev
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
architecture: 'x64'
- name: Install Python development packages
run: |
python -m pip install -U pip
pip install -U -r requirements-dev.txt
- name: Install Python package
run: |
pip install -r ./requirements.txt
pip install .
- name: Run Sphinx
run: tox -c tox.ini -e sphinx