-
Notifications
You must be signed in to change notification settings - Fork 45
72 lines (67 loc) · 2.11 KB
/
ci.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
on:
push:
branches: [main]
pull_request:
name: ci
env:
# Bump this to invalidate all caches
cache-version: 1
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
py:
- { version: "3.7", tox: "37" }
- { version: "3.8", tox: "38" }
- { version: "3.9", tox: "39" }
- { version: "3.10", tox: "310" }
- { version: "3.11", tox: "311" }
env:
run-matrix-combo: ${{ matrix.py.version }}
name: Test ${{ matrix.py.version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py.version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }}
restore-keys: |
${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip
- name: Install tox
run: pip install -U tox
- name: Run tox test factors for python ${{ matrix.py.version }}
run: >
tox
--skip-missing-interpreters=true
-f py${{ matrix.py.tox }}-ci
lint:
runs-on: ubuntu-latest
strategy:
matrix:
target: [lint-ci, docs-ci, mypy-ci]
py:
- { version: "3.10" }
env:
run-matrix-combo: ${{ matrix.py.version }}-${{ matrix.target }}
name: ${{ matrix.target }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py.version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }}
restore-keys: |
${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip
- name: Install tox
run: pip install -U tox
- name: Run tox factors ${{ matrix.target }}
run: tox -f ${{ matrix.target }}