-
Notifications
You must be signed in to change notification settings - Fork 34
66 lines (56 loc) · 1.52 KB
/
python.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
name: Python tests
on:
push:
branches: [latest]
pull_request:
branches: [latest]
schedule:
- cron: "0 0 7 * *" # monthly
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
py: ["3.10", 3.9, 3.8]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-v2-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: tox cache
uses: actions/cache@v3
with:
path: .tox/
key: ${{ runner.os }}-tox-v2-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-tox-v2
- name: Test with tox
run: tox
env:
PYTHONDEVMODE: 1
- name: Upload Python coverage to codecov
uses: codecov/codecov-action@v3
with:
flags: python
fail_ci_if_error: true
files: coverage.xml