test: add src to pythonpath for pytest
This commit is contained in:
parent
591bf68420
commit
4aaa975fbc
|
|
@ -5,17 +5,22 @@ jobs:
|
||||||
runs-on: podman
|
runs-on: podman
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Python
|
||||||
- name: Run pre-commit checks
|
|
||||||
run: |
|
run: |
|
||||||
pip install pre-commit
|
pip install pre-commit
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
|
|
||||||
- name: Build FastAPI image
|
- name: Build FastAPI image
|
||||||
run: |
|
run: |
|
||||||
podman build -t cmmc-fastapi:${{ forgejo.sha }} \
|
podman build -t cmmc-fastapi:${{ forgejo.sha }} \
|
||||||
-f .container-images/fastapi.Dockerfile .
|
-f .container-images/fastapi.Dockerfile .
|
||||||
|
|
||||||
# optional push to internal registry:
|
tests:
|
||||||
# - name: Push image
|
runs-on: podman
|
||||||
# run: podman push cmmc-fastapi:${{ forgejo.sha }} <registry>/<path>:${{ forgejo.sha }}
|
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
|
build: ## build FastAPI image locally
|
||||||
podman build -t cmmc-fastapi:latest -f .container-images/fastapi.Dockerfile .
|
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