Skip to content

Commit 58ad004

Browse files
authored
Merge pull request #288 from asherf/tox3
Switch to Github actions
2 parents c0f04b5 + 0b7d808 commit 58ad004

File tree

6 files changed

+87
-47
lines changed

6 files changed

+87
-47
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- "*"
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
test:
11+
timeout-minutes: 30
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.6", "3.7", "3.8", "3.9"]
16+
os: [ubuntu-latest]
17+
runs-on: ${{ matrix.os }}
18+
name: "${{ matrix.os }} Python: ${{ matrix.python-version }}"
19+
services:
20+
redis:
21+
image: redis:6.2.6
22+
ports:
23+
- 6379:6379
24+
memcached:
25+
image: memcached:1.6.12
26+
ports:
27+
- 11211:11211
28+
mysql:
29+
image: mysql:8.0.27
30+
env:
31+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
32+
ports:
33+
- 3306:3306
34+
postgresql:
35+
image: postgis/postgis:14-master
36+
env:
37+
POSTGRES_HOST_AUTH_METHOD: trust
38+
ports:
39+
- 5432:5432
40+
steps:
41+
- uses: actions/checkout@v2
42+
with:
43+
fetch-depth: 0
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v2
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
- name: Install dependencies
49+
run: |
50+
pip install -U "pip>=21.1"
51+
pip install -U setuptools "tox>=3.23.0,<4" codecov tox-gh-actions coverage
52+
sudo apt-get update
53+
sudo apt-get install binutils libproj-dev gdal-bin
54+
- name: Log versions
55+
run: |
56+
python --version
57+
pip --version
58+
psql -V
59+
mysql -V
60+
- name: prep DB
61+
env:
62+
MYSQL_TCP_PORT: 3306
63+
MYSQL_HOST: localhost
64+
PGHOST: localhost
65+
PGPORT: 5432
66+
run: |
67+
psql -U postgres -c 'CREATE DATABASE postgis'
68+
psql -U postgres postgis -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
69+
mysql --protocol=TCP --user=root -e 'create database django_prometheus_1;'
70+
- name: Run test and linters via Tox
71+
run: tox
72+
- name: Process code coverage
73+
run: |
74+
coverage combine .coverage django_prometheus/tests/end2end/.coverage
75+
coverage xml

.travis.yml

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

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Dev
44

5+
* Switch to Github Actions CI, remove travis-ci.
6+
57
## v2.1.0 - August 22, 2020
68

79
* Remove support for older django and python versions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Export Django monitoring metrics for Prometheus.io
55
[![Join the chat at https://gitter.im/django-prometheus/community](https://badges.gitter.im/django-prometheus/community.svg)](https://gitter.im/django-prometheus/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66

77
[![PyPI version](https://badge.fury.io/py/django-prometheus.svg)](http://badge.fury.io/py/django-prometheus)
8-
[![Build Status](https://travis-ci.org/korfuri/django-prometheus.svg?branch=master)](https://travis-ci.org/korfuri/django-prometheus)
8+
[![Build Status](https://github.com/korfuri/django-prometheus/actions/workflows/ci.yml/badge.svg)](https://github.com/korfuri/django-prometheus/actions/workflows/ci.yml)
99
[![Coverage Status](https://coveralls.io/repos/github/korfuri/django-prometheus/badge.svg?branch=master)](https://coveralls.io/github/korfuri/django-prometheus?branch=master)
1010
[![PyPi page link -- Python versions](https://img.shields.io/pypi/pyversions/django-prometheus.svg)](https://pypi.python.org/pypi/django-prometheus)
1111
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

django_prometheus/tests/end2end/testapp/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
"mysql": {
7676
"ENGINE": "django_prometheus.db.backends.mysql",
7777
"NAME": "django_prometheus_1",
78-
"USER": "travis",
78+
"USER": "root",
7979
"PASSWORD": "",
80-
"HOST": "localhost",
80+
"HOST": "127.0.0.1",
8181
"PORT": "3306",
8282
},
8383
# The following databases are used by test_db.py only
@@ -132,7 +132,7 @@
132132
TIME_ZONE = "UTC"
133133
USE_I18N = True
134134
USE_L10N = True
135-
USE_TZ = True
135+
USE_TZ = False
136136

137137

138138
# Static files (CSS, JavaScript, Images)

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
[tox]
22
envlist = {py36,py37,py38}-django{220,300,310,320}-{end2end,unittests},py38-lint
33

4+
[gh-actions]
5+
python =
6+
3.6: py36
7+
3.7: py37
8+
3.8: py38, py38-lint
9+
410
[testenv]
511
deps =
612
django220: Django>=2.2,<2.3

0 commit comments

Comments
 (0)