Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BACKEND: Python Django, REST and DB #4

Merged
merged 9 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading