Skip to content

Merge pull request #5 from sopherapps/dependabot/pip/requirements/fas… #54

Merge pull request #5 from sopherapps/dependabot/pip/requirements/fas…

Merge pull request #5 from sopherapps/dependabot/pip/requirements/fas… #54

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- "v*"
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: test_db
POSTGRES_PASSWORD: password4uNme
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mongodb:
image: mongo:latest
env:
MONGO_INITDB_ROOT_USERNAME: mongo_user
MONGO_INITDB_ROOT_PASSWORD: mongo_pass
ports:
- 27017:27017
# Set health checks to wait until mongo has started
options: >-
--health-cmd "echo 'db.stats().ok' | mongosh localhost:27017/test --quiet"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python --version
pip install -r requirements/dev.txt
- name: Lint with black
run: black --check .
- name: Run tests
run: |
cd $GITHUB_WORKSPACE
pytest
env:
TEST_PG_DATABASE_URI: "postgresql://postgres:password4uNme@localhost:5432/test_db"
TEST_MONGO_DATABASE_URI: "mongodb://mongo_user:mongo_pass@localhost:27017"