Skip to content

Commit a2209be

Browse files
committed
Use GitHub Actions for tests.
1 parent 7d9ee0e commit a2209be

File tree

4 files changed

+52
-27
lines changed

4 files changed

+52
-27
lines changed

.github/workflows/test.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: ["master"]
7+
pull_request:
8+
branches: ["master"]
9+
workflow_dispatch:
10+
11+
jobs:
12+
tests:
13+
name: "Python ${{ matrix.python-version }}"
14+
runs-on: "ubuntu-latest"
15+
services:
16+
redis:
17+
image: redis
18+
options: >-
19+
--health-cmd "redis-cli ping"
20+
--health-interval 10s
21+
--health-timeout 5s
22+
--health-retries 5
23+
ports:
24+
- 6379:6379
25+
strategy:
26+
matrix:
27+
python-version: ["3.6", "3.7", "3.8"]
28+
steps:
29+
- uses: "actions/checkout@v2"
30+
- uses: "actions/setup-python@v2"
31+
with:
32+
python-version: "${{ matrix.python-version }}"
33+
- name: "Install dependencies"
34+
run: |
35+
set -xe
36+
python -m pip install --upgrade pip setuptools
37+
python -m pip install --upgrade poetry tox tox-gh-actions
38+
39+
- name: "Run tox targets for ${{ matrix.python-version }}"
40+
run: "python -m tox"

.travis.yml

-23
This file was deleted.

README.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ Do you have tests?
4444

4545
You betcha!
4646

47-
.. image:: https://secure.travis-ci.org/codeinthehole/django-cacheback.png
48-
:target: https://travis-ci.org/#!/codeinthehole/django-cacheback
47+
.. image:: https://github.com/codeinthehole/django-cacheback/workflows/CI/badge.svg?branch=master
48+
:target: https://github.com/codeinthehole/django-cacheback/actions?workflow=CI
49+
:alt: CI Status
4950

5051

5152
Can I use this in my project?

tox.ini

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
isolated_build = true
33
envlist = py{36,37,38}-django{20,21,22,30,31}
44

5+
[gh-actions]
6+
python =
7+
3.6: py36
8+
3.7: py37
9+
3.8: py38
10+
511
[testenv]
612
setenv = PYTHONPATH={toxinidir}
713
deps =
@@ -15,5 +21,6 @@ whitelist_externals =
1521
sh
1622
skip_install = true
1723
commands =
18-
sh -c 'poetry export --dev --without-hashes | grep -v "^[dD]jango==" | poetry run pip install --no-deps -r /dev/stdin'
19-
poetry run pytest --isort --flake8 --black --cov
24+
poetry export --dev --without-hashes -o {toxworkdir}/requirements.txt
25+
sh -c 'grep -v "^[dD]jango==" {toxworkdir}/requirements.txt | poetry run pip install --no-deps -r /dev/stdin'
26+
poetry run pytest --isort --flake8 --black --cov

0 commit comments

Comments
 (0)