Skip to content

optimize the json_to_db_migration script #768

optimize the json_to_db_migration script

optimize the json_to_db_migration script #768

name: Backend checks
on:
push:
branches: [ "master" ]
paths: ["backend/**"]
pull_request:
branches: [ "master" ]
paths: ["backend/**"]
permissions:
contents: read
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install python dependencies
run: |
source $HOME/.venv/bin/activate
cd backend;
cd requirements
pip install -r requirements.txt
pip install -r test-requirements.txt
pip install -r plugins-requirements.txt
pip install -r extra-requirements.txt
cd ..
mkdir logs/
cp ~/login_creds.sh ./
cp ~/config.env ./
- name: Lint with pyright, Ruff and Mypy
run: |
cd backend
source $HOME/.venv/bin/activate
./pylint.sh
- name: Start dmart service and run curl.sh
run: |
export XDG_RUNTIME_DIR="/run/user/$UID"
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
source $HOME/.venv/bin/activate
cd backend
systemctl --user stop dmart
dropdb --if-exists -h 127.0.0.1 -U dmart dmart
createdb -h 127.0.0.1 -U dmart dmart
alembic upgrade head
./migrate.py json_to_db
./reload.sh
./curl.sh
systemctl --user stop dmart
- name: Test with pytest
run: |
systemctl --user stop dmart
source $HOME/.venv/bin/activate
cd backend; pytest
- name: Install frontend js depdenencies
run: |
# cd frontend; yarn install
- name: Build frontend
run: |
# cd frontend; yarn build
- name: Check svelte
run: |
# cd frontend; ./node_modules/.bin/svelte-check