Merge pull request 'dev' (#7) from dev into main

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2025-11-25 09:51:05 +00:00
2 changed files with 55 additions and 35 deletions

View File

@@ -5,7 +5,7 @@ on:
types: [opened, synchronize, edited, reopened]
jobs:
build-and-smoke:
build-image:
runs-on: ubuntu-latest
steps:
@@ -17,24 +17,47 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install
with:
python-version-file: "pyproject.toml"
- name: Install the project dependencies
- name: (optional) Prepare dependencies
run: |
uv sync --all-groups
uv add pip
uv export --format requirements.txt -o requirements.txt
# uv run python -m pip install --upgrade pip
# uv run python -m pip install -r requirements.txt
uv python install --python-version-file pyproject.toml || true
uv sync --all-groups || true
uv add pip || true
uv export --format requirements.txt -o requirements.txt || true
- name: Build image
run: |
docker build -t semapform-api:test-pr .
- name: Save image artifact
run: |
docker save semapform-api:test-pr -o semapform-api.tar
- name: Upload image artifact
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
with:
name: semapform-image
path: semapform-api.tar
smoke-tests:
needs: build-image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download image artifact
uses: christopherhx/gitea-download-artifact@v4
with:
name: semapform-image
- name: Restore image
run: |
docker load -i semapform-api.tar
- name: Start container (background)
run: |
# do NOT bind the container port to the host to avoid port conflicts on the runner
docker run -d --name semapform-test semapform-api:test-pr sleep infinity
- name: Start server in container and smoke test HTTP (in-container)
@@ -46,7 +69,6 @@ jobs:
# show container status to aid debugging
docker ps -a --filter name=semapform-test || true
# perform a readiness loop (try container-local /health) using small execs
echo "waiting for service to become ready inside container"
set -e
READY=0
@@ -64,11 +86,9 @@ jobs:
exit 1
fi
# Run the repository smoke-test script inside the container and surface its output
echo "running test_api.py inside container"
docker exec semapform-test python test_api.py || true
# dump the last 200 lines of logs so this step always displays useful output
docker logs semapform-test --tail 200 || true
- name: Cleanup container

View File

@@ -5,7 +5,7 @@ description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"bibapi>=0.0.5",
"bibapi[catalogue]>=0.0.6",
"fastapi>=0.122.0",
"uvicorn>=0.38.0",
]