Skip to content

Commit

Permalink
feat(backend): Python Django, REST and DB (#4)
Browse files Browse the repository at this point in the history
* feature: necessary entities, Postgre connected to project
CRUD for a project in progress

* feature: .gitignore  fix: secret_key moved from settiggs.py to .env

* fix: i forgot to stage the remainig changes

* feature: serializers for all models, views API for models  fix: Objective field names

* fix: report_creater`s field in Report model

* fix: objective_color field in Objective_serializer, added __pycache__ from migrations to .gitignore, removed garbage from admin.py, report_creator field in Report model

* refactor(.env): put secret key placeholder

* feat(ci, backend): change structs for django app, add venv, add pipe

* ci(python): put version for py3.11

---------

Co-authored-by: Marat Zimnurov <[email protected]>
  • Loading branch information
avinogrado and the-homeless-god authored Aug 15, 2024
1 parent d78557d commit 66f57d0
Show file tree
Hide file tree
Showing 133 changed files with 565 additions and 27,304 deletions.
69 changes: 57 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@ on:

name: validation of code
jobs:
build:
defaults:
run:
working-directory: application/frontend
name: linters, tests and build
basic:
name: preparation
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
issues: write
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v3
- name: telegram notifications
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
run: |
Expand All @@ -36,6 +26,22 @@ jobs:
curl -s -X POST 'https://api.telegram.org/bot${{ secrets.TG_TOKEN }}/sendMessage' \
-d "parse_mode=MarkdownV2&chat_id=${{ secrets.TG_CHAT_ID }}&text=${msg_text}&reply_to_message_id=${{ secrets.TG_MSG_ID }}"
frontend:
defaults:
run:
working-directory: application/frontend
name: linters, tests and build
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
issues: write
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: v21.1.0
Expand All @@ -45,3 +51,42 @@ jobs:
# - run: npm run format
# - run: npm run test:coverage
- run: npm run build

backend:
defaults:
run:
working-directory: application/backend
name: linters, tests and build
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
issues: write
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: 3.11

- uses: actions/cache@v2
id: cache-venv # name for referring later
with:
path: ./.venv/ # what we cache: the virtualenv
# The cache key depends on requirements.txt
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-venv-
# Build a virtualenv, but only if it doesn't already exist
- run: python -m venv ./.venv && . ./.venv/bin/activate &&
pip install -r requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'

# Note that you have to activate the virtualenv in every step
# because GitHub actions doesn't preserve the environment
- run: . ./.venv/bin/activate && make lint_code
# - run: . ./.venv/bin/activate && make test_unit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
__pycache__
85 changes: 0 additions & 85 deletions application/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions application/TrafficLight.sln

This file was deleted.

109 changes: 0 additions & 109 deletions application/TrafficLight/Controllers/ProjectController.cs

This file was deleted.

Loading

0 comments on commit 66f57d0

Please sign in to comment.