Skip to content

Commit 2873549

Browse files
committed
Switch to GitHub Actions and pytest
1 parent c9b94d1 commit 2873549

File tree

3 files changed

+78
-12
lines changed

3 files changed

+78
-12
lines changed

.github/workflows/tests.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2+
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
3+
4+
name: "Tests"
5+
6+
on:
7+
push:
8+
pull_request:
9+
workflow_dispatch:
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
tests:
17+
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
18+
runs-on: "${{ matrix.os }}"
19+
20+
strategy:
21+
matrix:
22+
os:
23+
- ubuntu-latest
24+
- macos-latest
25+
- windows-latest
26+
python-version:
27+
# When changing this list, be sure to check the [gh-actions] list in
28+
# tox.ini so that tox will run properly.
29+
- "2.7"
30+
- "3.6"
31+
- "3.7"
32+
- "3.8"
33+
- "3.9"
34+
exclude:
35+
# Windows 2.7 doesn't work because Microsoft removed stuff we needed.
36+
- os: windows-latest
37+
python-version: "2.7"
38+
fail-fast: false
39+
40+
steps:
41+
- name: "Check out the repo"
42+
uses: "actions/checkout@v2"
43+
44+
- name: "Set up Python"
45+
uses: "actions/setup-python@v2"
46+
with:
47+
python-version: "${{ matrix.python-version }}"
48+
49+
- name: "Install dependencies"
50+
run: |
51+
set -xe
52+
python -VV
53+
python -m site
54+
python -m pip install -r requirements.txt
55+
python -m pip install tox-gh-actions
56+
57+
- name: "Run tox for ${{ matrix.python-version }}"
58+
run: |
59+
# GitHub Actions on Windows sets TEMP to a shortname, and HOME to a
60+
# longname. Eventually, filename comparisons fail because of the
61+
# difference. Fix $TEMP.
62+
echo $TEMP
63+
if [ "$RUNNER_OS" == "Windows" ]; then
64+
export TMP=$HOME\\AppData\\Local\\Temp
65+
export TEMP=$HOME\\AppData\\Local\\Temp
66+
fi
67+
echo $TEMP
68+
python -m tox

.travis.yml

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

tox.ini

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ envlist =
2323

2424
[testenv]
2525
deps =
26+
pytest
2627
unittest-mixins==1.6
2728
django18: Django>=1.8,<1.9
2829
django19: Django>=1.9,<1.10
@@ -38,7 +39,7 @@ deps =
3839

3940
commands =
4041
python -c "import tests.banner"
41-
python -m unittest {posargs:discover -b}
42+
python -m pytest {posargs}
4243

4344
usedevelop = True
4445

@@ -70,3 +71,11 @@ deps =
7071

7172
commands =
7273
rst2html.py --strict README.rst /tmp/django_coverage_plugin_README.html
74+
75+
[gh-actions]
76+
python =
77+
2.7: py27
78+
3.6: py36
79+
3.7: py37
80+
3.8: py38
81+
3.9: py39

0 commit comments

Comments
 (0)