Replaced travis with GitHub action workflow. #142
parent
294f8520ab
commit
70ed000f08
|
|
@ -0,0 +1,41 @@
|
|||
name: Python package
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- 5432:5432
|
||||
# needed because the postgres container does not provide a healthcheck
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install psycopg2 prerequisites
|
||||
run: sudo apt-get install libpq-dev
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-test.txt
|
||||
pip install tox tox-gh-actions
|
||||
- name: Test with tox
|
||||
run: tox
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
[](https://badges.pufler.dev)
|
||||
[](https://github.com/fabiocaccamo/django-admin-interface/blob/master/LICENSE.txt)
|
||||
|
||||
[](https://travis-ci.org/fabiocaccamo/django-admin-interface)
|
||||
[](https://github.com/fabiocaccamo/django-admin-interface)
|
||||
[](https://codecov.io/gh/fabiocaccamo/django-admin-interface)
|
||||
[](https://www.codacy.com/app/fabiocaccamo/django-admin-interface)
|
||||
[](https://codeclimate.com/github/fabiocaccamo/django-admin-interface/)
|
||||
|
|
@ -152,6 +152,7 @@ git clone https://github.com/fabiocaccamo/django-admin-interface.git src && cd s
|
|||
|
||||
# install dependencies
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-test.txt
|
||||
|
||||
# run tests
|
||||
tox
|
||||
|
|
@ -176,8 +177,6 @@ If you are using this package in commercial project(s), please consider the idea
|
|||
|
||||
- [GitHub Sponsor](https://github.com/sponsors/fabiocaccamo)
|
||||
- [PayPal](https://www.paypal.me/fabiocaccamo)
|
||||
- BTC: bc1q2t0pv8z3udpyuvfnx5kskhqdad4dcvtfuzmvjw
|
||||
- ETH: 0x8B55Fb7798b5A9F797A4455C00821B6e53daca74
|
||||
|
||||
## See also
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
codecov
|
||||
coverage
|
||||
psycopg2
|
||||
tox
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
codecov
|
||||
coverage
|
||||
django>=1.7
|
||||
django-colorfield
|
||||
django-flat-theme
|
||||
django-flat-responsive
|
||||
six>=1.9.0
|
||||
tox
|
||||
1
setup.py
1
setup.py
|
|
@ -69,6 +69,7 @@ setup(
|
|||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Topic :: Software Development :: Build Tools',
|
||||
],
|
||||
license='MIT',
|
||||
|
|
|
|||
|
|
@ -89,6 +89,12 @@ database_config = {
|
|||
}
|
||||
}
|
||||
|
||||
github_workflow = os.environ.get('GITHUB_WORKFLOW')
|
||||
if github_workflow:
|
||||
database_config['postgres']['NAME'] = 'postgres'
|
||||
database_config['postgres']['HOST'] = '127.0.0.1'
|
||||
database_config['postgres']['PORT'] = '5432'
|
||||
|
||||
DATABASES = {
|
||||
'default': database_config.get(database_engine),
|
||||
}
|
||||
|
|
|
|||
23
tox.ini
23
tox.ini
|
|
@ -1,13 +1,23 @@
|
|||
[tox]
|
||||
envlist =
|
||||
py27-{dj17,dj18,dj19,dj110,dj111}-{sqlite,postgres},
|
||||
py35-{dj18,dj19,dj110,dj111,dj20,dj21,dj22}-{sqlite,postgres},
|
||||
py36-{dj18,dj19,dj110,dj111,dj20,dj21,dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py37-{dj20,dj21,dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py38-{dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py39-{dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py36-{dj18,dj19,dj110,dj111,dj20,dj21,dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py37-{dj20,dj21,dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py38-{dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py39-{dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py310-{dj32}-{sqlite,postgres},
|
||||
|
||||
[gh-actions]
|
||||
python =
|
||||
2.7: py27
|
||||
3.6: py36
|
||||
3.7: py37
|
||||
3.8: py38
|
||||
3.9: py39
|
||||
3.10: py310
|
||||
|
||||
[testenv]
|
||||
passenv = CI TRAVIS TRAVIS_*
|
||||
passenv = CI GITHUB_WORKFLOW
|
||||
deps =
|
||||
dj17: Django == 1.7.*
|
||||
dj18: Django == 1.8.*
|
||||
|
|
@ -20,7 +30,6 @@ deps =
|
|||
dj30: Django == 3.0.*
|
||||
dj31: Django == 3.1.*
|
||||
dj32: Django == 3.2.*
|
||||
djmaster: https://github.com/django/django/archive/master.tar.gz
|
||||
# mysql: mysqlclient
|
||||
postgres: psycopg2-binary
|
||||
coverage
|
||||
|
|
|
|||
Loading…
Reference in New Issue