Skip to content

Commit

Permalink
Merge branch 'main' into add-redoc-api
Browse files Browse the repository at this point in the history
  • Loading branch information
danangmassandy committed Jun 26, 2024
2 parents 8e491b5 + 80cb1b0 commit 8486a60
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 23 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
django_app_test:
needs: flake8_py3
name: 'Django App'
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -64,7 +65,10 @@ jobs:
cd ../
make dev
make wait-db
make dev-entrypoint
make sleep
make migrate
make npm-install
make build-react
make dev-runserver
make dev-load-demo-data
make sleep
Expand Down Expand Up @@ -92,5 +96,22 @@ jobs:
# path: playwright/ci-test/playwright-report/
# retention-days: 30

- name: Test backend
run: make dev-test
- name: Run Coverage test
working-directory: deployment
run: |
cat << EOF | docker-compose exec -T dev bash
python manage.py collectstatic --noinput --verbosity 0
export DJANGO_SETTINGS_MODULE=core.settings.dev && coverage run manage.py test && coverage xml
EOF
docker cp dev:/home/web/django_project/coverage.xml ../coverage.xml
- name: Show Coverage
if: ${{ github.event_name == 'pull_request' }}
uses: orgoro/coverage@v3
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ dev-test:
@docker-compose exec -T dev python manage.py collectstatic --noinput
@docker-compose exec -T dev python manage.py test --keepdb --noinput

npm-install:
@echo
@echo "------------------------------------------------------------------"
@echo "Install frontend dependencies"
@echo "------------------------------------------------------------------"
@docker-compose ${ARGS} exec -T dev npm --prefix /home/web/django_project/frontend install

migrate:
@echo
@echo "------------------------------------------------------------------"
@echo "Running migration"
@echo "------------------------------------------------------------------"
@docker-compose ${ARGS} exec -T dev python manage.py migrate

build-react:
@echo
@echo "------------------------------------------------------------------"
@echo "Execute webpack build command"
@echo "------------------------------------------------------------------"
@docker-compose ${ARGS} exec -T dev npm --prefix /home/web/django_project/frontend run build

serve:
@echo
@echo "------------------------------------------------------------------"
Expand Down
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
coverage:
range: 50..75
round: down
precision: 2
status:
project:
default:
target: 80
changes: false
patch:
default:
threshold: "5%"
ignore:
- "**/migrations/*.py"
6 changes: 4 additions & 2 deletions django_project/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'core.wsgi.application'

# import SECRET_KEY into current namespace
# noinspection PyUnresolvedReferences
from core.settings.secret import SECRET_KEY # noqa

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand Down Expand Up @@ -144,5 +148,3 @@

LOGIN_URL = '/account/login/'
LOGIN_REDIRECT_URL = '/'

from .secret import SECRET_KEY # noqa
2 changes: 1 addition & 1 deletion docs/mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ nav:
- Developers:
- developer/index.md
- Documentation:
- "Data model": developer/documentation/data-model.md
- "Data model": developer/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ some_url: https://github.com/kartoza/tomorrownow_gap.git
copyright: Copyright 2024, Kartoza
contact:
license: This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
context_id:
#context_id: 1234
---

# Data model diagram

## Ground observations

![database design](./img/ground-observations-database-design-1.png)
![database design](./diagram/ground-observations-database-design-1.png)

14 changes: 0 additions & 14 deletions docs/src/developer/documentation/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/src/developer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ some_url: https://github.com/kartoza/tomorrownow_gap.git
copyright: Copyright 2024, Kartoza
contact:
license: This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
context_id:
#context_id: 1234
---

# For Developers
Expand Down

0 comments on commit 8486a60

Please sign in to comment.