Skip to content

fix: node version update #48

fix: node version update

fix: node version update #48

name: Zevrin Backend Styles
on:
push:
branches: [main, develop]
pull_request:
workflow_dispatch:
jobs:
backend_ci:
name: Zevrin Backend - lint & tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
services:
mongo:
image: mongo:7
ports:
- 27017:27017
options: >-
--health-cmd="mongosh --eval 'db.runCommand({ ping: 1 })'"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
run: |
cat << EOF > .env
DB_USER=admin
DB_PASSWORD=password
DB_HOST=mongo
DB_NAME=zevrin_test
MONGODB_URL=mongodb://mongo:27017/zevrin_test
DEBUG=1
FRONT_END_PROD_URL=http://localhost:3000
FRONT_END_DEV_URL=http://localhost:3000
COLLECTION_PRODUCTS=products
COLLECTION_USER=users
COLLECTION_CART=cart
COLLECTION_PROMOTION=promotions
COLLECTION_BANNERS=banners
COLLECTION_CATEGORIES=categories
JWT_ENCODE_ALGORITHM=HS256
JWT_ACCESS_TOKEN_SECRET_KEY=${JWT_ACCESS_KEY}
JWT_REFRESH_TOKEN_SECRET_KEY=${JWT_REFRESH_KEY}
JWT_ACCESS_TOKEN_EXPIRE_TIME_MINUTES=30
JWT_REFRESH_TOKEN_EXPIRE_TIME_MINUTES=10080
MINIO_PORT=9000
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
MINIO_SERVER=http://minio:9000
EOF
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run lint & formatting checks
run: make check
- name: Run pytest
env:
MONGODB_URL: mongodb://mongo:27017
run: pytest tests/test_run.py -v --tb=short