This document explains how continuous integration works across the Freegle ecosystem using CircleCI.
The Freegle project uses a centralized testing approach where the FreegleDocker repository orchestrates integration testing for all components. Individual repositories trigger tests in FreegleDocker rather than running their own isolated tests.
- Integration Testing: Tests the complete system as users experience it
- Resource Efficiency: One comprehensive test environment vs. multiple isolated ones
- Realistic Testing: Tests against production-like Docker Compose stack
- Consistency: All components tested together with same configuration
- Prevents Live System Contamination: Playwright tests run in controlled environment
| Repository | Local CI | Integration Testing | Playwright Tests |
|---|---|---|---|
| FreegleDocker | ✅ Full integration testing | ✅ Coordinates all testing | ✅ Runs all E2E tests |
| iznik-server-go | ✅ Go unit tests | ➡️ Triggers FreegleDocker | ❌ None (runs in FreegleDocker) |
| iznik-server | ✅ PHP unit tests | ➡️ Triggers FreegleDocker | ❌ None (runs in FreegleDocker) |
| iznik-nuxt3 | ❌ No local tests | ➡️ Triggers FreegleDocker | ➡️ Tests run in FreegleDocker |
| iznik-nuxt3-modtools | ❌ No local tests | ➡️ Triggers FreegleDocker | ➡️ Tests run in FreegleDocker |
graph LR
A[Developer pushes to submodule] --> B[GitHub Actions webhook]
B --> C[Triggers FreegleDocker CircleCI]
C --> D[Full integration testing]
Each submodule contains .github/workflows/trigger-parent-ci.yml that automatically triggers FreegleDocker testing when changes are pushed.
FreegleDocker CircleCI Pipeline:
- Submodule Update: Updates all submodules to latest commits
- Environment Setup: Builds complete Docker Compose stack
- Service Readiness: Waits for all services to be healthy
- Integration Testing: Currently runs Playwright end-to-end tests (Go/PHP unit tests may be added in future)
- Result Processing: Commits successful updates or reports failures
Go API Server (iznik-server-go):
- Local CircleCI: Go unit tests, benchmarks, race detection
- Integration: API endpoints tested via Playwright in FreegleDocker
- Future: Go tests may move to FreegleDocker for unified testing
PHP API Server (iznik-server):
- Local CircleCI: PHPUnit tests with MySQL, Redis, PostgreSQL
- Integration: Legacy API endpoints tested via Playwright in FreegleDocker
- Future: PHP tests may move to FreegleDocker for unified testing
User Website (iznik-nuxt3):
- No local CI (avoids live system contamination)
- Integration: Full Playwright test suite in FreegleDocker
ModTools Website (iznik-nuxt3-modtools):
- No local CI (avoids live system contamination)
- Integration: ModTools functionality tested in FreegleDocker
scheduled-submodule-check:
schedule: "0 0,6,12,18 * * *" # Every 6 hours
branch: master
purpose: Regular automated submodule updatesbuild-and-test:
triggers: Push to master or manual trigger
purpose: Test integration on direct changeswebhook-triggered:
triggers: API calls from submodule repositories
purpose: Immediate testing when submodules changeThe following variables should be configured in CircleCI:
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_PUSH_KEY=your_google_push_key
GOOGLE_VISION_KEY=your_google_vision_key
GOOGLE_PERSPECTIVE_KEY=your_google_perspective_key
GOOGLE_GEMINI_API_KEY=your_google_gemini_key
GOOGLE_PROJECT=your_google_project_id
GOOGLE_APP_NAME=Freegle
MAPBOX_KEY=your_mapbox_key
MAXMIND_ACCOUNT=your_maxmind_account
MAXMIND_KEY=your_maxmind_keyIZNIK_SERVER_BRANCH=master
IZNIK_SERVER_GO_BRANCH=master
IZNIK_NUXT3_BRANCH=master
IZNIK_NUXT3_MODTOOLS_BRANCH=masterEach submodule repository requires a CIRCLECI_TOKEN secret:
- Get CircleCI API Token: CircleCI → Personal API Tokens
- Add to each submodule: Settings → Secrets and Variables → Actions
- Secret name:
CIRCLECI_TOKEN - Secret value: Your CircleCI API token
| Repository | Webhook Configured | Status |
|---|---|---|
| iznik-nuxt3 | ✅ .github/workflows/trigger-parent-ci.yml |
Active |
| iznik-nuxt3-modtools | ✅ .github/workflows/trigger-parent-ci.yml |
Active |
| iznik-server | ✅ .github/workflows/trigger-parent-ci.yml |
Active |
| iznik-server-go | ✅ .github/workflows/trigger-parent-ci.yml |
Active |
- Go to CircleCI FreegleDocker Project
- Click "Trigger Pipeline"
- Select branch and parameters
curl -X POST \
-H "Circle-Token: YOUR_CIRCLECI_TOKEN" \
-H "Content-Type: application/json" \
-d '{"branch": "master"}' \
https://circleci.com/api/v2/project/github/Freegle/FreegleDocker/pipelineEach CircleCI build collects:
- Docker Logs: Complete container startup logs
- Test Reports: Playwright HTML test results
- Container Status: Health check results
- Build Info: Commit details and environment info
Docker Environment Issues:
- Check container logs in build artifacts
- Verify service health check timeouts
- Review Docker Compose configuration
Test Failures:
- Access Playwright HTML reports via artifacts
- Check specific test failure patterns
- Review console errors and network issues
Webhook Failures:
- Verify
CIRCLECI_TOKENis properly configured - Check GitHub Actions workflow execution
- Validate API response in Actions logs