Marc Cataford
d3cc915039
* build(backend): test tooling setup + taskfile tidy * test(backend): add stub test * ci: run backend tests
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
version: '3'
|
|
|
|
env:
|
|
VENV_ACTIVATE: "/{{ .TASKFILE_DIR }}/backend/.venv/bin/activate"
|
|
|
|
tasks:
|
|
bootstrap:
|
|
internal: true
|
|
cmds:
|
|
- . script/bootstrap
|
|
dir: backend
|
|
lint:
|
|
desc: "Lints /backend using black + pylint."
|
|
deps: [bootstrap]
|
|
cmd: source {{ .VENV_ACTIVATE }} && black . --check && pylint ./rotini
|
|
dir: backend
|
|
lintfix:
|
|
desc: "Lints and fixes /backend using black + pylint."
|
|
deps: [bootstrap]
|
|
cmd: source {{ .VENV_ACTIVATE }} && black . && pylint ./rotini
|
|
dir: backend
|
|
test:
|
|
desc: "Run the test suites."
|
|
deps: [bootstrap]
|
|
cmd: source {{ .VENV_ACTIVATE }} && pytest .
|
|
dir: backend
|
|
start:
|
|
desc: "Starts the backend application."
|
|
deps: [bootstrap]
|
|
dotenv:
|
|
- "../.env"
|
|
cmd: source {{ .VENV_ACTIVATE }} && python -m uvicorn main:app
|
|
dir: backend/rotini
|
|
migrate:
|
|
desc: "Applies migrations. Usage: be:migrate -- <up|down>"
|
|
deps: [bootstrap]
|
|
dotenv:
|
|
- "../../.env"
|
|
cmds:
|
|
- source {{ .VENV_ACTIVATE }} && python migrate.py {{.CLI_ARGS}}
|
|
dir: backend/rotini/migrations
|
|
lock-deps:
|
|
desc: "Locks production and development dependencies"
|
|
deps: [bootstrap]
|
|
cmds:
|
|
- source {{ .VENV_ACTIVATE }} && . script/requirements-lock
|
|
dir: backend
|
|
|