mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 05:25:26 +02:00
feature/additional-db (#371)
* add support for setting db_url * fix tests * add db_username/password env variables * init db if super user doesn't exist * fix tests * fix tests * set SQLite default DB_URL * don't run tests on draft PRs * add lint/black tests * add test-all * spell check settings * black/flake8 * check format fail * new badges * rename workflow * fix formatting * remove white-space * test connection arguments for pg * format * add new values to template * format * remove old script * monkeypatch test db * working docker-compose for postgres * update docs * test pg workflow * format * add driver * install w/ poetry * setup container * change image * set database to localhost * update tests * set url * fix url path * disable cache * database init * bust cache * get by name Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
parent
52e5e9da5d
commit
c196445e61
33 changed files with 257 additions and 195 deletions
|
@ -8,12 +8,23 @@ on:
|
|||
branches:
|
||||
- master
|
||||
- dev
|
||||
types: [synchronize, opened, reopened, ready_for_review]
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
env:
|
||||
PRODUCTION: false
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres
|
||||
env:
|
||||
POSTGRES_USER: mealie
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_DB: mealie
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
steps:
|
||||
#----------------------------------------------
|
||||
# check-out repo and set-up python
|
||||
|
@ -32,9 +43,9 @@ jobs:
|
|||
with:
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
# #----------------------------------------------
|
||||
# # load cached venv if cache exists #! This Breaks Stuff
|
||||
# #----------------------------------------------
|
||||
#----------------------------------------------
|
||||
# load cached venv if cache exists
|
||||
#----------------------------------------------
|
||||
# - name: Load cached venv
|
||||
# id: cached-poetry-dependencies
|
||||
# uses: actions/cache@v2
|
||||
|
@ -45,11 +56,22 @@ jobs:
|
|||
# install dependencies if cache does not exist
|
||||
#----------------------------------------------
|
||||
- name: Install dependencies
|
||||
run: poetry install
|
||||
run: |
|
||||
poetry install
|
||||
poetry add "psycopg2-binary==2.8.6"
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
#----------------------------------------------
|
||||
# run test suite
|
||||
#----------------------------------------------
|
||||
- name: Run tests
|
||||
- name: Run Test Suite
|
||||
run: |
|
||||
poetry run pytest
|
||||
make test-all
|
||||
#----------------------------------------------
|
||||
# run test suite
|
||||
#----------------------------------------------
|
||||
- name: Run Test Suite Postgres
|
||||
env:
|
||||
DB_ENGINE: postgres
|
||||
POSTGRES_SERVER: localhost
|
||||
run: |
|
||||
make test-all
|
Loading…
Add table
Add a link
Reference in a new issue