-
-
Notifications
You must be signed in to change notification settings - Fork 4
168 lines (158 loc) · 4.78 KB
/
check.yaml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Check
on:
pull_request:
push:
workflow_dispatch:
schedule:
# Re-test every month
- cron: '0 2 1 * *'
env:
# more verbosity to make it easier to understand failures
PYTEST_FLAGS: -v --log-level=DEBUG
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Persistent Github pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.cfg', 'setup.py', 'Makefile') }}
restore-keys: |
pip-${{ runner.os }}-${{ matrix.python-version }}-
pip-${{ runner.os }}-
- name: Persistent Github venv cache
uses: actions/cache@v3
with:
path: .venv/
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'setup.cfg', 'setup.py', 'Makefile') }}
- name: Install dependencies
run: make venv
- name: flake8
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: flake8
run: make lint-flake8
- name: mypy
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: mypy
run: make lint-mypy
- name: isort
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: isort
run: make lint-isort
- name: pytest
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: pytest
run: make test
- name: readme
run: make readme
- name: check-wheel
run: make check-wheel
check-distro:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- 'debian:unstable'
- 'debian:testing'
- 'debian:stable'
- 'debian:oldstable'
- 'ubuntu:devel'
- 'ubuntu:rolling'
- 'ubuntu:latest'
container: ${{ matrix.image }}
steps:
- name: Install dependencies via apt
run: |
set -ex
export DEBIAN_FRONTEND=noninteractive
apt update
apt-cache --generate pkgnames \
| grep --line-regexp --fixed-strings \
-e git \
-e python3-bottle \
-e python3-build \
-e python3-click \
-e python3-click-option-group \
-e python3-configobj \
-e python3-cram \
-e python3-dateutil \
-e python3-flake8 \
-e python3-importlib-metadata \
-e python3-isort \
-e python3-jsonschema \
-e python3-mypy \
-e python3-pep517 \
-e python3-pip \
-e python3-pip-whl \
-e python3-platformdirs \
-e python3-pytest \
-e python3-requests-oauthlib \
-e python3-tabulate \
-e python3-typeshed \
-e python3-typing-extensions \
-e python3-venv \
-e python3-yaml \
-e twine \
| xargs apt install -y
- uses: actions/checkout@v3
- name: Workaround for https://github.com/actions/checkout/pull/762 not persisting
run: git config --global --add safe.directory "$PWD"
- name: Install remaining dependencies
run: make venv-system-site-packages
- name: flake8
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: flake8
run: make lint-flake8
- name: mypy
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: mypy
run: make lint-mypy
- name: isort
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: isort
run: make lint-isort
- name: pytest
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: pytest
run: make test
- name: readme
run: make readme
- name: check-wheel
run: make check-wheel
workflow-keepalive:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Re-enable workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api -X PUT repos/${{ github.repository }}/actions/workflows/check.yaml/enable