Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,64 @@ jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
port: [8080, 8090]
steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t codex-proxy:smoke .
run: docker build -t codex-proxy-test .

- name: Create custom config
if: matrix.port != 8080
run: |
mkdir -p config_override
echo "server:" > config_override/default.yaml
echo " port: ${{ matrix.port }}" >> config_override/default.yaml

- name: Start container
run: |
docker run -d --name smoke-test \
-p 18080:8080 \
-e NODE_ENV=production \
codex-proxy:smoke
if [ "${{ matrix.port }}" != "8080" ]; then
docker run -d --name test-container \
-p ${{ matrix.port }}:${{ matrix.port }} \
-e NODE_ENV=production \
-v $(pwd)/config_override/default.yaml:/app/config/default.yaml \
codex-proxy-test
else
docker run -d --name test-container \
-p 8080:8080 \
-e NODE_ENV=production \
codex-proxy-test
fi
echo "Container started"

- name: Wait for healthy
run: |
echo "Waiting for container to become healthy..."
for i in $(seq 1 30); do
STATUS=$(docker inspect --format='{{.State.Health.Status}}' smoke-test 2>/dev/null || echo "starting")
STATUS=$(docker inspect --format='{{.State.Health.Status}}' test-container 2>/dev/null || echo "starting")
echo " [$i/30] status: $STATUS"
if [ "$STATUS" = "healthy" ]; then
echo "Container is healthy"
exit 0
fi
sleep 2
sleep 1
done
echo "::error::Container did not become healthy within 60s"
docker logs smoke-test
echo "::error::Container did not become healthy within 30s"
docker logs test-container
exit 1

- name: Verify /health endpoint
run: |
RESPONSE=$(curl -sf http://localhost:18080/health)
RESPONSE=$(curl -sf http://localhost:${{ matrix.port }}/health)
echo "Response: $RESPONSE"
echo "$RESPONSE" | jq -e '.status == "ok"'

- name: Verify /v1/models returns valid JSON
run: |
# Without auth, should return 401 or model list — either way must be valid JSON
STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:18080/v1/models)
STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:${{ matrix.port }}/v1/models)
echo "/v1/models status: $STATUS"
# 200 (no key set) or 401 (key set) are both acceptable
if [ "$STATUS" != "200" ] && [ "$STATUS" != "401" ]; then
Expand All @@ -78,5 +96,5 @@ jobs:
- name: Cleanup
if: always()
run: |
docker logs smoke-test 2>&1 | tail -30
docker rm -f smoke-test || true
docker logs test-container 2>&1 | tail -30
docker rm -f test-container || true