From 85c9572b092492d3a39be35d269dbc3e7453ed69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4ufl?= Date: Mon, 21 Sep 2020 18:28:02 +0200 Subject: [PATCH] Run tests with GitHub Actions --- .github/workflows/tests.yml | 78 +++++++++++++++++++++++++++++++++++++ tox.ini | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..380683cc7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,78 @@ +--- +name: Tests +on: [push, pull_request] + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.5, 3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Ensure latest setuptools + run: | + python -m pip install --upgrade pip setuptools + - name: Install dependencies + run: | + python -m pip install coverage tox tox-factor unittest-xml-reporting + - name: Run tox + run: | + python -m pip --version + python -m tox --version + python -m tox -f py$(python --version 2>&1 | cut -c 8,10) + - name: Coverage reporting + run: | + coverage combine + coverage report -m + coverage xml + coverage html + - name: Publish coverage results + uses: codecov/codecov-action@v1 + + + isort: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Ensure latest setuptools + run: | + python -m pip install --upgrade pip setuptools + - name: Install dependencies + run: | + python -m pip install tox + - name: Run tox + run: | + python -m pip --version + python -m tox --version + python -m tox -e isort,lint,docs + + + warnings: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Ensure latest setuptools + run: | + python -m pip install --upgrade pip setuptools + - name: Install dependencies + run: | + python -m pip install tox + - name: Run tox + run: | + python -m pip --version + python -m tox --version + python -m tox -e warnings diff --git a/tox.ini b/tox.ini index 576eb6cd9..e52b621ce 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ setenv = deps = django22: django~=2.2.0 django30: django~=3.0.0 - django31: django>=3.1rc1,<3.2 + django31: django~=3.1.0 djangorestframework~=3.11.0 latest: {[latest]deps} -rrequirements/test-ci.txt