Skip to content

Commit

Permalink
Migrate from Travis CI to GitHub Actions (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnm committed Aug 31, 2021
1 parent 31305af commit 8ffb8f1
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 70 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[run]
branch = True
relative_files = True
source =
hub
kpi
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/pytest-with-coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: pytest

on:
push:
branches: [ master, beta ]
pull_request:
branches: [ master, beta ]

jobs:
build:
runs-on: ubuntu-20.04
env:
DATABASE_URL: postgis://kobo:kobo@localhost:5432/kpi_test
DJANGO_LANGUAGE_CODES: "en ar es fr hi ku pl pt zh-hans"
DJANGO_SECRET_KEY: notSecretJustForTestingYep
DJANGO_SETTINGS_MODULE: kobo.settings.testing
REDIS_SESSION_URL: redis://localhost:6379
strategy:
matrix:
python-version: ['3.8']
services:
postgres:
image: postgis/postgis:9.5-2.5
env:
POSTGRES_USER: kobo
POSTGRES_PASSWORD: kobo
POSTGRES_DB: kpi_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis_cache:
image: redis:3.2
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install pip-tools
run: python -m pip install pip-tools
- name: Update Debian package lists
run: sudo DEBIAN_FRONTEND=noninteractive apt-get -y update
- name: Install Debian dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential fontforge gettext git-core libpcre3 libpcre3-dev libpq-dev
- name: Install Python dependencies
run: pip-sync dependencies/pip/dev_requirements.txt
- name: Update translations
run: git submodule init && git submodule update --remote && python manage.py compilemessages
- name: Run pytest
run: pytest --cov=. -vvra
- name: Run coveralls
uses: AndreMiras/coveralls-python-action@develop
# TODO: npm install; npm run copy-fonts; npm run build; npm run test
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

9 changes: 6 additions & 3 deletions dependencies/pip/dev_requirements.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
-r requirements.in

Fabric
coverage
coveralls
ipython
pytest-django
pytest-env
pytest
mock
mongomock
pytest
pytest-cov
pytest-django
pytest-env
15 changes: 15 additions & 0 deletions dependencies/pip/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ cffi==1.13.2
# pynacl
chardet==3.0.4
# via requests
coverage==5.5
# via
# -r dependencies/pip/dev_requirements.in
# coveralls
# pytest-cov
coveralls==3.2.0
# via -r dependencies/pip/dev_requirements.in
cryptography==2.8
# via
# paramiko
Expand Down Expand Up @@ -147,6 +154,8 @@ djangorestframework==3.10.3
# drf-extensions
djangorestframework-xml==1.4.0
# via -r dependencies/pip/requirements.in
docopt==0.6.2
# via coveralls
docutils==0.15.2
# via
# botocore
Expand Down Expand Up @@ -266,8 +275,11 @@ pyrsistent==0.15.5
pytest==5.2.2
# via
# -r dependencies/pip/dev_requirements.in
# pytest-cov
# pytest-django
# pytest-env
pytest-cov==2.12.1
# via -r dependencies/pip/dev_requirements.in
pytest-django==3.7.0
# via -r dependencies/pip/dev_requirements.in
pytest-env==0.6.2
Expand Down Expand Up @@ -296,6 +308,7 @@ redis==3.3.11
requests==2.22.0
# via
# -r dependencies/pip/requirements.in
# coveralls
# django-oauth-toolkit
# responses
responses==0.10.6
Expand Down Expand Up @@ -337,6 +350,8 @@ statistics==1.0.3.5
# via formpack
tabulate==0.8.5
# via -r dependencies/pip/requirements.in
toml==0.10.2
# via pytest-cov
traceback2==1.4.0
# via unittest2
traitlets==4.3.3
Expand Down

0 comments on commit 8ffb8f1

Please sign in to comment.