Skip to content

Commit

Permalink
installing rum
Browse files Browse the repository at this point in the history
  • Loading branch information
abraryaser02 committed May 12, 2024
1 parent 5229ab7 commit 64f71a8
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:

services:
postgres:
image: custom-postgres:latest
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: backend_test
ports:
- 5432:5432
- 5435:5432

steps:
- uses: actions/checkout@v2
Expand All @@ -30,10 +30,6 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-
- name: Build custom PostgreSQL image
run: |
docker build -t custom-postgres:latest -f services/postgres/Dockerfile .
- name: Build backend image
run: |
docker build -t backend-dev:latest -f services/backend/Dockerfile-dev .
Expand All @@ -43,33 +39,38 @@ jobs:
with:
python-version: '3.12'

- name: Install dependencies
- name: Install dependencies and set up RUM
run: |
python -m pip install --upgrade pip
pip install -r services/backend/requirements.txt
sudo apt-get update
sudo apt-get install -y git build-essential postgresql-server-dev-13 postgresql-13-rum
git clone https://github.com/postgrespro/rum /tmp/rum
cd /tmp/rum
make USE_PGXS=1
sudo make USE_PGXS=1 install
- name: Wait for Postgres
run: |
until pg_isready -h localhost -p 5432 -U postgres; do
until pg_isready -h localhost -p 5435 -U postgres; do
echo "Waiting for postgres container..."
sleep 20
done
- name: Set up Docker Compose
- name: Run Docker Compose
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
DATABASE_URL: postgresql://postgres:postgres@localhost:5435/backend_dev
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5435/backend_test
APP_SETTINGS: project.config.TestingConfig
PYTHONPATH: services/backend
run: |
cd services/backend
export APP_SETTINGS=project.config.TestingConfig
export PYTHONPATH=$(pwd)
export DATABASE_TEST_URL=postgresql://postgres:postgres@localhost:5432/backend_test
export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/backend_dev
export DATABASE_TEST_URL=postgresql://postgres:postgres@localhost:5435/backend_test
export DATABASE_URL=postgresql://postgres:postgres@localhost:5435/backend_dev
pytest

0 comments on commit 64f71a8

Please sign in to comment.