Skip to content

Commit e691f67

Browse files
committed
Use tox to run tests
1 parent 51a5e77 commit e691f67

File tree

2 files changed

+29
-34
lines changed

2 files changed

+29
-34
lines changed

.github/workflows/tests.yaml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,32 @@ name: Tests
22

33
on:
44
push:
5-
branches: [master]
5+
branches: ["master"]
66
pull_request:
7-
branches: [master]
7+
branches: ["master"]
88
schedule:
9-
- cron: '0 0 * * 0'
9+
- cron: "0 0 * * 0"
1010

1111
jobs:
1212
test:
13-
name: Test Python ${{ matrix.python-version }}
14-
runs-on: ubuntu-latest
13+
name: "Python ${{ matrix.python-version }}"
14+
runs-on: "ubuntu-latest"
1515

1616
strategy:
17+
fail-fast: false
1718
matrix:
18-
python-version: [2.7, 3.7, 3.8, 3.9]
19+
python-version: ["2.7", "3.7", "3.8", "3.9"]
1920

2021
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v2
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
22+
uses: "actions/checkout@v2"
23+
uses: "actions/setup-python@v2"
2524
with:
26-
python-version: ${{ matrix.python-version }}
27-
- name: Pip cache
28-
uses: actions/cache@v2
29-
with:
30-
path: ~/.cache/pip
31-
key: ${{ runner.os }}-pip
32-
restore-keys: |
33-
${{ runner.os }}-pip
34-
- name: Pre-install
35-
run: |
36-
python -m pip install -U pip
37-
- name: Install package
38-
run: |
39-
python -m pip install -e .[test]
40-
- name: Test
25+
python-version: "${{ matrix.python-version }}"
26+
- name: "Install dependencies"
4127
run: |
42-
python -m pytest -v -rxXs --cov planet --cov-report term-missing
28+
python -VV
29+
python -m site
30+
python -m pip install --upgrade pip setuptools wheel
31+
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
32+
- name: "Run tox targets for ${{ matrix.python-version }}"
33+
run: "python -m tox"

tox.ini

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# Tox (https://tox.readthedocs.io/) is a tool for running tests
2-
# in multiple virtualenvs. This configuration file will run the
3-
# test suite on all supported python versions. To use it, "pip install tox"
4-
# and then run "tox" from this directory.
5-
61
[tox]
72
envlist = py27, py36, py37
83

4+
[gh-actions]
5+
python =
6+
2.7: py27
7+
3.5: py35
8+
3.6: py36
9+
3.7: py37
10+
3.8: py38
11+
3.9: py39
12+
913
[testenv]
1014
deps = pytest
11-
commands =
12-
pip install -e .[dev]
13-
pytest {posargs}
15+
commands =
16+
python -m pip install -e .[dev]
17+
python -m pytest -v -rxXs --cov planet --cov-report term-missing

0 commit comments

Comments
 (0)