Merge pull request #611 from edraj/soheyb-v3 #755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
pip install -r requirements/core.txt -r requirements/extra.txt -r requirements/plugins.txt -r requirements/test.txt | |
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 | |