Skip to content

BACKEND: (feat)Python Logger #22

BACKEND: (feat)Python Logger

BACKEND: (feat)Python Logger #22

Workflow file for this run

on:
pull_request:
branches:
- dev
- master
name: validation of code
jobs:
basic:
name: preparation
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: telegram notifications
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
run: |
msg_text='New pull request to master:
Title:
```json
${{github.event.pull_request.title}}
```
[Link](${{github.event.pull_request.html_url}})
'
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: frontend - 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
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- run: npm ci
- run: npm run format
- run: npm run lint
- run: npm run build
backend:
defaults:
run:
working-directory: application/backend
name: backend - 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