Skip to content

Commit 6a6f807

Browse files
authored
Switch pipeline to Github Actions (#866)
1 parent f3d3d05 commit 6a6f807

File tree

3 files changed

+68
-54
lines changed

3 files changed

+68
-54
lines changed

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Test and lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
tests:
12+
name: Run tests
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
# Python 3.4 disabled, due to problems with GitHub Actions.
18+
python-version: [3.10-dev, 3.9, 3.8, 3.7, 3.6, 3.5, 2.7]
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install -r test-requirements.txt
34+
35+
- name: Run tests
36+
env:
37+
PYTHON_VERSION: ${{ matrix.python-version }}
38+
run: |
39+
export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"`
40+
if [[ $PYTHON_VERSION < '3.7' ]]; then pytest $PYTHONPATH; fi
41+
42+
if [[ $PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi
43+
export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"`
44+
pytest $PYTHONPATH
45+
46+
linting:
47+
name: Run linting
48+
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- uses: actions/checkout@v2
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v2
56+
with:
57+
python-version: 3.8
58+
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip
62+
pip install -r test-requirements.txt
63+
64+
- name: Run linting
65+
run: |
66+
flake8
67+
flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py

.travis.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
flake8; python_version >= '3.6'
22
flake8-bugbear; python_version >= '3.6'
33
flake8-pyi; python_version >= '3.6'
4-
pytest>=4.4.1; python_version >= '3.4'
4+
pytest==4.6.11
55
pytest-xdist>=1.18; python_version >= '3.4'
66
pytest-cov>=2.4.0; python_version >= '3.4'

0 commit comments

Comments
 (0)