-
Notifications
You must be signed in to change notification settings - Fork 116
130 lines (121 loc) · 3.89 KB
/
tests.yml
File metadata and controls
130 lines (121 loc) · 3.89 KB
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
# This workflow will install Python dependencies, lint, and run tests in supported versions of Python.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: tests
on:
push:
branches: [ "master", "gha" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
pytest:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- python-version: "3.7"
os: ubuntu-22.04
- python-version: "3.8"
os: ubuntu-24.04
- python-version: "3.9"
os: ubuntu-24.04
- python-version: "3.10"
os: ubuntu-24.04
- python-version: "3.11"
os: ubuntu-24.04
- python-version: "3.12"
os: ubuntu-24.04
- python-version: "3.13"
os: ubuntu-24.04
- python-version: "3.14"
os: ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
env:
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"
- name: Display Python ${{ matrix.python-version }} version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/pytest.txt
- name: Test with pytest
run: |
coverage run -m pytest
coverage report -m
pytest-python3-legacy:
strategy:
matrix:
python-version:
- "3.5"
- "3.6"
runs-on: ubuntu-latest
container: python:${{ matrix.python-version }}
steps:
- uses: actions/checkout@v6
- name: Display Python ${{ matrix.python-version }} version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/pytest.txt
- name: Test with pytest
run: |
coverage run -m pytest
coverage report -m
pytest-python27:
runs-on: ubuntu-latest
container: coatldev/six:latest
steps:
- uses: actions/checkout@v6
- name: Display Python 2.7 version
run: python2 -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python2 -m pip install --upgrade pip
pip2 install -r requirements/pytest.txt
- name: Test with pytest
run: |
coverage2 run -m pytest
coverage2 report -m
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Display Python verison
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/flake8.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pip-install-local:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Test pip install
run: |
pip install .
python -c 'from intervaltree import IntervalTree; t = IntervalTree(); print(t)'