Skip to content

Commit

Permalink
Merge branch 'feature/consul-integration' of https://github.com/gnss-…
Browse files Browse the repository at this point in the history
…lab/API-Gateway into feature/consul-integration
  • Loading branch information
fedmog1lnkv committed Sep 4, 2023
2 parents c455151 + e0f9951 commit 59a5a85
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/test_user_service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Run Tests

on:
push:
branches:
- feature/consul-integration

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: user_service_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

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

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies
run: |
cd user_service
poetry install
- name: Set up environment variables
run: |
echo "SECRET_KEY=random_key" >> user_service/.env
echo "TEST=True" >> user_service/.env
echo "FASTAPI_IP=127.0.0.1" >> user_service/.env
echo "FASTAPI_PORT=8001" >> user_service/.env
echo "POSTGRES_HOST=localhost" >> user_service/.env
echo "POSTGRES_PORT=5432" >> user_service/.env
echo "POSTGRES_DB=user_service_db" >> user_service/.env
echo "POSTGRES_USER=postgres" >> user_service/.env
echo "POSTGRES_PASSWORD=1234" >> user_service/.env
- name: Run tests
run: |
cd user_service
poetry run python -m pytest tests

0 comments on commit 59a5a85

Please sign in to comment.