avoid doing stuff outside of nox
This commit is contained in:
parent
8d20ef6956
commit
cf1e1a79d9
|
@ -119,20 +119,23 @@ jobs:
|
||||||
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
|
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
|
||||||
nox --version
|
nox --version
|
||||||
|
|
||||||
- name: Checkout Samples
|
# when we get an imcompatible sqlite migration again and need to combine all migrations into one for the benefit of sqlite
|
||||||
if: matrix.database == 'sqlite'
|
# see if we can get the sqlite-specific block in the noxfile.py to work instead of this block in the github workflow,
|
||||||
uses: actions/checkout@v3
|
# which annoyingly runs python setup outside of the nox environment (which seems to be flakier on poetry install).
|
||||||
with:
|
# - name: Checkout Samples
|
||||||
repository: sartography/sample-process-models
|
# if: matrix.database == 'sqlite'
|
||||||
path: sample-process-models
|
# uses: actions/checkout@v3
|
||||||
- name: Poetry Install
|
# with:
|
||||||
if: matrix.database == 'sqlite'
|
# repository: sartography/sample-process-models
|
||||||
run: poetry install
|
# path: sample-process-models
|
||||||
- name: Setup sqlite
|
# - name: Poetry Install
|
||||||
if: matrix.database == 'sqlite'
|
# if: matrix.database == 'sqlite'
|
||||||
env:
|
# run: poetry install
|
||||||
SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR: "${GITHUB_WORKSPACE}/sample-process-models"
|
# - name: Setup sqlite
|
||||||
run: ./bin/recreate_db clean rmall
|
# if: matrix.database == 'sqlite'
|
||||||
|
# env:
|
||||||
|
# SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR: "${GITHUB_WORKSPACE}/sample-process-models"
|
||||||
|
# run: ./bin/recreate_db clean rmall
|
||||||
|
|
||||||
- name: Setup Mysql
|
- name: Setup Mysql
|
||||||
uses: mirromutth/mysql-action@v1.1
|
uses: mirromutth/mysql-action@v1.1
|
||||||
|
|
|
@ -41,6 +41,18 @@ def setup_database(session: Session) -> None:
|
||||||
session.env[flask_env_key] = "e7711a3ba96c46c68e084a86952de16f"
|
session.env[flask_env_key] = "e7711a3ba96c46c68e084a86952de16f"
|
||||||
session.env["FLASK_APP"] = "src/spiffworkflow_backend"
|
session.env["FLASK_APP"] = "src/spiffworkflow_backend"
|
||||||
session.env["SPIFFWORKFLOW_BACKEND_ENV"] = "unit_testing"
|
session.env["SPIFFWORKFLOW_BACKEND_ENV"] = "unit_testing"
|
||||||
|
|
||||||
|
if os.environ.get("SPIFFWORKFLOW_BACKEND_DATABASE_TYPE") == "sqlite":
|
||||||
|
# maybe replace this sqlite-specific block with ./bin/recreate_db clean rmall
|
||||||
|
# (if we can make it work, since it uses poetry),
|
||||||
|
# which would also remove the migrations folder and re-create things as a single migration
|
||||||
|
if os.path.exists("migrations"):
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
shutil.rmtree("migrations")
|
||||||
|
for task in ["init", "migrate"]:
|
||||||
|
session.run("flask", "db", task)
|
||||||
|
|
||||||
session.run("flask", "db", "upgrade")
|
session.run("flask", "db", "upgrade")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue