Skip to content

Commit

Permalink
Initial GitHub Actions workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Nov 25, 2020
1 parent 50da341 commit aaa5798
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]

services:
postgres:
image: postgres:10
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
restore-keys: |
-${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Tox tests
run: |
tox -v
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
6 changes: 3 additions & 3 deletions auditlog_tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('TEST_DB_NAME', 'auditlog_tests_db'),
'NAME': os.getenv('TEST_DB_NAME', 'postgres'),
'USER': os.getenv('TEST_DB_USER', 'postgres'),
'PASSWORD': os.getenv('TEST_DB_PASS', ''),
'HOST': os.getenv('TEST_DB_HOST', '127.0.0.1'),
'PASSWORD': os.getenv('TEST_DB_PASS', 'postgres'),
'HOST': os.getenv('TEST_DB_HOST', 'postgres'),
'PORT': os.getenv('TEST_DB_PORT', '5432'),
}
}
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ changedir = docs/source
deps = -rdocs/requirements.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[travis]
[gh-actions]
python =
2.7: py27
3.5: py35
3.6: py36
3.7: py37
Expand Down

0 comments on commit aaa5798

Please sign in to comment.