-
-
Notifications
You must be signed in to change notification settings - Fork 167
58 lines (55 loc) · 1.94 KB
/
tests.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
name: tests
on:
push:
branches: [ 4.x ]
pull_request:
schedule:
- cron: '21 7 * * 0' # run once a week on Sunday
workflow_dispatch:
jobs:
build:
strategy:
matrix:
config:
# [Python version, tox env, OS ]
# see for version: https://github.com/raw/actions/python-versions/main/versions-manifest.json
# see for runners: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# - ["2.7", "py27", "ubuntu-22.04"]
- ["pypy2.7", "pypy", "ubuntu-22.04"]
- ["3.4.10", "py34", "ubuntu-18.04"]
- ["3.5.10", "py35", "ubuntu-20.04"]
- ["3.6.15", "py36", "ubuntu-20.04"]
- ["3.7.17", "py37", "ubuntu-22.04"]
- ["3.8.18", "py38", "ubuntu-latest"]
- ["3.9", "py39", "ubuntu-latest"]
- ["3.10", "py310", "ubuntu-latest"]
- ["pypy3.9", "pypy3", "ubuntu-latest"]
runs-on: ${{ matrix.config[2] }}
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Coverage
if: matrix.config[0] != '2.7' && matrix.config[0] != 'pypy-2.7' && matrix.config[0] != '3.4.10'
run: |
pip install coveralls coverage-python-version
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}