Add GitHub Actions CI/CD pipeline and test framework

- Add .github/workflows/build-test.yml for automated testing
- Add tests/ directory with TypeScript test runner
- Add docs/CICD.md documentation
- Remove .gitlab-ci.yml (migrated to GitHub Actions)
- Update .gitignore for test artifacts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shang Chieh Tseng
2025-12-15 14:06:44 +08:00
parent 2b5aeaf86b
commit d11140c016
23 changed files with 3014 additions and 50 deletions

View File

@@ -0,0 +1,31 @@
id: TC-RUNTIME-001
name: Container Startup
suite: runtime
priority: 1
timeout: 120000
dependencies:
- TC-BUILD-002
steps:
- name: Stop existing container
command: cd docker && docker compose down 2>/dev/null || true
- name: Start container with GPU
command: cd docker && docker compose up -d
- name: Wait for startup
command: sleep 15
- name: Check container status
command: cd docker && docker compose ps
criteria: |
The ollama37 container should start successfully with GPU access.
Expected:
- Container starts without errors
- docker compose ps shows container in "Up" state
- No "Exited" or "Restarting" status
Accept startup warnings. Container should be running.

View File

@@ -0,0 +1,29 @@
id: TC-RUNTIME-002
name: GPU Detection
suite: runtime
priority: 2
timeout: 60000
dependencies:
- TC-RUNTIME-001
steps:
- name: Check nvidia-smi inside container
command: docker exec ollama37 nvidia-smi
- name: Check CUDA libraries
command: docker exec ollama37 ldconfig -p | grep -i cuda | head -5
- name: Check Ollama GPU detection
command: cd docker && docker compose logs 2>&1 | grep -i gpu | head -10
criteria: |
Tesla K80 GPU should be detected inside the container.
Expected:
- nvidia-smi shows Tesla K80 GPU(s)
- Driver version 470.x (or compatible)
- CUDA libraries are available (libcuda, libcublas, etc.)
- Ollama logs mention GPU detection
The K80 has 12GB VRAM per GPU. Accept variations in reported memory.

View File

@@ -0,0 +1,39 @@
id: TC-RUNTIME-003
name: Health Check
suite: runtime
priority: 3
timeout: 180000
dependencies:
- TC-RUNTIME-001
steps:
- name: Wait for health check
command: |
for i in {1..30}; do
STATUS=$(docker inspect ollama37 --format='{{.State.Health.Status}}' 2>/dev/null || echo "starting")
echo "Health status: $STATUS (attempt $i/30)"
if [ "$STATUS" = "healthy" ]; then
echo "Container is healthy"
exit 0
fi
sleep 5
done
echo "Health check timeout"
exit 1
- name: Test API endpoint
command: curl -s http://localhost:11434/api/tags
- name: Check Ollama version
command: docker exec ollama37 ollama --version
criteria: |
Ollama server should be healthy and API responsive.
Expected:
- Container health status becomes "healthy"
- /api/tags endpoint returns JSON response (even if empty models)
- ollama --version shows version information
Accept any valid JSON response from API. Version format may vary.