feat; Set up ansible to deploy to aws instance #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python CI | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
ports: | |
- '5432:5432' | |
env: | |
POSTGRES_USER: location-user | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: location-db | |
options: --health-cmd="pg_isready -U location-user -d location-db" --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Verify installed packages | |
run: | | |
pip list | |
- name: Run tests with pytest | |
run: | | |
pytest --maxfail=5 --disable-warnings |