Skip to content

login/logout and demouser buttons working as well as the welcome on d… #37

login/logout and demouser buttons working as well as the welcome on d…

login/logout and demouser buttons working as well as the welcome on d… #37

Workflow file for this run

name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:6
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
cd backend
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Install Node.js dependencies
run: |
cd frontend
npm install
- name: Run backend tests
env:
FLASK_ENV: testing
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
REDIS_URL: redis://localhost:6379/0
SECRET_KEY: test-key
JWT_SECRET_KEY: test-jwt-key
run: |
cd backend
pytest --cov=app --cov-report=xml
- name: Run frontend unit tests
run: |
cd frontend
npm run test
- name: Run E2E tests
env:
CYPRESS_BASE_URL: http://localhost:3000
CYPRESS_API_URL: http://localhost:5000/api
run: |
# Start backend
cd backend
flask run &
sleep 5
# Start frontend
cd ../frontend
npm start &
sleep 10
# Run Cypress tests
npm run test:e2e
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./backend/coverage.xml,./frontend/coverage/coverage-final.json
flags: backend,frontend
name: codecov-umbrella
fail_ci_if_error: true