diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 63fcf3c..48f7cae 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -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 }} /:${{ 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 diff --git a/Makefile b/Makefile index 4141314..ec631b1 100644 --- a/Makefile +++ b/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 diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..a635c5c --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +pythonpath = . diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29