Skip to content

Commit 68ee8f1

Browse files
committed
Test on GitHub Actions
1 parent 7f66f8b commit 68ee8f1

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
FORCE_COLOR: 1
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Cache
16+
uses: actions/cache@v2
17+
with:
18+
path: |
19+
~/.cache/pip
20+
~/.cache/pre-commit
21+
key:
22+
lint-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
23+
restore-keys: |
24+
lint-v1-
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: 3.8
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install -U pip
34+
python -m pip install pre-commit
35+
36+
- name: Lint
37+
run: |
38+
pre-commit run --all-files --show-diff-on-failure
39+
env:
40+
PRE_COMMIT_COLOR: always

.github/workflows/test.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
FORCE_COLOR: 1
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: [
15+
"3.5",
16+
"3.6",
17+
"3.7",
18+
"3.8",
19+
"pypy3",
20+
]
21+
pytest-version: [
22+
"5.0.1",
23+
"5.1.3",
24+
"5.2.4",
25+
"5.3.5",
26+
"5.4.3",
27+
"6.0.2",
28+
"6.1.0",
29+
]
30+
steps:
31+
- uses: actions/checkout@v2
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Get pip cache dir
39+
id: pip-cache
40+
run: |
41+
echo "::set-output name=dir::$(pip cache dir)"
42+
43+
- name: Cache
44+
uses: actions/cache@v2
45+
with:
46+
path: ${{ steps.pip-cache.outputs.dir }}
47+
key:
48+
${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pytest-version }}-v1-${{ hashFiles('**/setup.py') }}
49+
restore-keys: |
50+
${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pytest-version }}-v1-
51+
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install -U pip
55+
python -m pip install pytest==${{ matrix.pytest-version }}
56+
python -m pip install -e .
57+
58+
- name: Tests
59+
shell: bash
60+
run: |
61+
pytest

0 commit comments

Comments
 (0)