Skip to content
Open
Show file tree
Hide file tree
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
89 changes: 89 additions & 0 deletions .github/workflows/docker-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Docker Smoke Test

on:
push:
branches: [master]
pull_request:

jobs:
smoke-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Run container on port 8080
run: |
docker run -d -p 8080:8080 --name codex-proxy-test codex-proxy-test

# Wait for healthcheck (up to 30s)
echo "Waiting for healthcheck..."
for i in {1..15}; do
STATUS=$(docker inspect --format='{{.State.Health.Status}}' codex-proxy-test 2>/dev/null || echo "starting")
if [ "$STATUS" = "healthy" ]; then
echo "Container is healthy"
break
fi
sleep 2
done

if [ "$STATUS" != "healthy" ]; then
echo "::error::Container failed to become healthy on port 8080"
docker logs codex-proxy-test
exit 1
fi

- name: Verify /health returns 200 on port 8080
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health)
if [ "$STATUS" != "200" ]; then
echo "::error::Expected 200 from /health, got $STATUS"
docker logs codex-proxy-test
exit 1
fi

- name: Cleanup port 8080 container
run: |
docker rm -f codex-proxy-test

- name: Test custom port 8090
run: |
# Modify config for port 8090
sed -i 's/port: 8080/port: 8090/g' config/default.yaml

# Run container with mounted config
docker run -d -p 8090:8090 -v $(pwd)/config/default.yaml:/app/config/default.yaml --name codex-proxy-test-8090 codex-proxy-test

# Wait for healthcheck (up to 30s)
echo "Waiting for healthcheck on port 8090..."
for i in {1..15}; do
STATUS=$(docker inspect --format='{{.State.Health.Status}}' codex-proxy-test-8090 2>/dev/null || echo "starting")
if [ "$STATUS" = "healthy" ]; then
echo "Container is healthy on port 8090"
break
fi
sleep 2
done

if [ "$STATUS" != "healthy" ]; then
echo "::error::Container failed to become healthy on port 8090"
docker logs codex-proxy-test-8090
exit 1
fi

- name: Verify /health returns 200 on port 8090
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8090/health)
if [ "$STATUS" != "200" ]; then
echo "::error::Expected 200 from /health on 8090, got $STATUS"
docker logs codex-proxy-test-8090
exit 1
fi

- name: Final cleanup
if: always()
run: |
docker rm -f codex-proxy-test-8090 || true
40 changes: 40 additions & 0 deletions .github/workflows/electron-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Electron Smoke Test

on:
push:
branches: [master]
paths:
- 'packages/electron/**'
pull_request:
paths:
- 'packages/electron/**'

jobs:
smoke-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci

- name: Build web frontend + tsc backend
run: npm run build

- name: Build desktop frontend
run: cd packages/electron && npm run build

- name: Prepare pack
run: cd packages/electron && node electron/prepare-pack.mjs

- name: Package with electron-builder
run: cd packages/electron && npx electron-builder --linux --dir --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Playwright deps
run: npx playwright install --with-deps chromium

- name: Run launch smoke test
run: cd packages/electron && xvfb-run -a npm run test -- __tests__/launch/smoke.test.ts
22 changes: 22 additions & 0 deletions .github/workflows/web-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Web Smoke Test

on:
push:
branches: [master]
pull_request:

jobs:
smoke-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci

- name: Build web frontend + backend
run: npm run build

- name: Run web smoke test
run: npm test -- src/__tests__/web-smoke.test.ts
Loading
Loading