feat: ♻️ Refactoring models to own queries against tables #67
Workflow file for this run
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
# Runs Python Tests | |
name: Python Tests | |
on: [push, pull_request] | |
jobs: | |
run-pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build stack | |
run: docker-compose up -d | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install and Configure poetry | |
run: | | |
python -m pip install poetry==1.8.2 | |
python -m poetry config virtualenvs.in-project true | |
- name: Cache the virtualenv | |
uses: actions/cache@v4 | |
with: | |
path: ./.venv | |
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: python -m poetry install | |
- name: Run tests | |
env: | |
# These are largely development default values | |
OANDA_ACCOUNT_ID: ${{secrets.OANDA_ACCOUNT_ID}} | |
OANDA_TOKEN: ${{secrets.OANDA_TOKEN}} | |
APP_RANDOM_WALK: "True" | |
TIMESCALE_HOST: 127.0.0.1 | |
TIMESCALE_PORT: 5432 | |
TIMESCALE_DB: project_foresight | |
TIMESCALE_USER: postgres | |
TIMESCALE_PASSWORD: postgres | |
AWS_ENDPOINT_URL: http://localhost:4566 | |
AWS_ACCESS_KEY_ID: test | |
AWS_SECRET_ACCESS_KEY: test | |
AWS_REGION: us-east-1 | |
run: python -m poetry run python -m pytest --disable-warnings -xv --cov=. --cov-report=xml | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
pytest-xml-coverage-path: ./coverage.xml | |
title: Code Coverage | |
badge-title: Code Coverage | |
hide-badge: false | |
hide-report: false | |
create-new-comment: false | |
hide-comment: false | |
report-only-changed-files: false | |
remove-link-from-badge: false | |
unique-id-for-comment: python3.9 |