Skip to content

Commit

Permalink
Fixig workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
abraryaser02 committed May 10, 2024
1 parent a07054b commit ca37cdf
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
name: Python Tests
name: Backend Test

on:
push:
branches:
- master
pull_request:
branches:
- master
on: [push, pull_request]

jobs:
test:
name: Run pytest

runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: backend_test
ports:
- 5435:5432
options: --health-interval 10s --health-timeout 5s --health-retries 5
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r services/backend/requirements.txt
- name: Run tests
env:
APP_SETTINGS: project.config.TestingConfig
DATABASE_URL: postgresql://postgres:postgres@localhost:5435/backend_test
run: |
python -m pytest services/backend/tests
- name: docker
run: |
docker-compose -f docker-compose-dev.yml up --build -d
sleep 20
- name: Run tests
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/backend_dev
DATABASE_TEST_URL: postgres://postgres:postgres@localhost:5432/backend_test
APP_SETTINGS: project.config.TestingConfig
PYTHONPATH: services/backend
run: |
cd services/backend
pytest

0 comments on commit ca37cdf

Please sign in to comment.