test: add src to pythonpath for pytest
This commit is contained in:
parent
591bf68420
commit
4aaa975fbc
|
|
@ -5,17 +5,22 @@ jobs:
|
|||
runs-on: podman
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run pre-commit checks
|
||||
- name: Setup Python
|
||||
run: |
|
||||
pip install pre-commit
|
||||
pre-commit run --all-files
|
||||
|
||||
- name: Build FastAPI image
|
||||
run: |
|
||||
podman build -t cmmc-fastapi:${{ forgejo.sha }} \
|
||||
-f .container-images/fastapi.Dockerfile .
|
||||
|
||||
# optional push to internal registry:
|
||||
# - name: Push image
|
||||
# run: podman push cmmc-fastapi:${{ forgejo.sha }} <registry>/<path>:${{ forgejo.sha }}
|
||||
tests:
|
||||
runs-on: podman
|
||||
needs: lint-build
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install test deps
|
||||
run: |
|
||||
pip install -r requirements.txt -r requirements-dev.txt
|
||||
- name: Run pytest
|
||||
run: pytest -q
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -12,4 +12,8 @@ logs: ## follow logs
|
|||
build: ## build FastAPI image locally
|
||||
podman build -t cmmc-fastapi:latest -f .container-images/fastapi.Dockerfile .
|
||||
|
||||
.PHONY: up down logs build
|
||||
test: ## run pytest quietly
|
||||
pytest -q
|
||||
|
||||
|
||||
.PHONY: up down logs build test
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
[pytest]
|
||||
pythonpath = .
|
||||
Loading…
Reference in New Issue