📝 docs: update CI/CD documentation for container/services approach
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# 16. CI/CD Pipeline Design for Multi-Platform Compatibility
|
||||
|
||||
**Date:** 2026-04-05
|
||||
**Status:** 🟡 Proposed
|
||||
**Status:** ✅ Accepted
|
||||
**Authors:** Arcodange Team
|
||||
**Decision Date:** TBD
|
||||
**Implementation Status:** Not Started
|
||||
**Decision Date:** 2026-04-08
|
||||
**Implementation Status:** ✅ Completed
|
||||
|
||||
## Context
|
||||
|
||||
@@ -758,7 +758,81 @@ graph TD
|
||||
|
||||
---
|
||||
|
||||
**Status:** Proposed
|
||||
**Next Review:** 2026-04-12
|
||||
## Implementation Status
|
||||
|
||||
### ✅ Completed - Container/Services Architecture
|
||||
|
||||
The CI/CD pipeline has been successfully implemented using GitHub Actions' container/services architecture:
|
||||
|
||||
**Key Implementation Details:**
|
||||
|
||||
1. **Container-based Execution**: All CI steps run within a pre-built Docker cache image containing Go tools, Node.js, and PostgreSQL client
|
||||
2. **Service-based PostgreSQL**: Database provided as a service container, accessible via `postgres` hostname
|
||||
3. **Smart Caching**: Dependency hash calculated from `go.mod`, `go.sum`, and `Dockerfile.build` for accurate cache invalidation
|
||||
4. **Environment Configuration**: Database connection parameters set via `DLC_*` environment variables
|
||||
5. **Simplified Workflow**: Removed Docker Compose overhead and unnecessary setup steps
|
||||
|
||||
**Current Workflow Structure:**
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
build-cache:
|
||||
name: Build Docker Cache
|
||||
# Calculates dependency hash and builds cache image if needed
|
||||
|
||||
ci-pipeline:
|
||||
name: CI Pipeline
|
||||
needs: build-cache
|
||||
container:
|
||||
image: gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ needs.build-cache.outputs.deps_hash }}
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: dance_lessons_coach_bdd_test
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set database environment variables
|
||||
run: |
|
||||
echo "DLC_DATABASE_HOST=postgres" >> $GITHUB_ENV
|
||||
echo "DLC_DATABASE_PORT=5432" >> $GITHUB_ENV
|
||||
# ... other database config
|
||||
|
||||
- name: Generate Swagger Docs
|
||||
run: go generate ./pkg/server
|
||||
|
||||
- name: Build all packages
|
||||
run: go build ./...
|
||||
|
||||
- name: Wait for PostgreSQL to be ready
|
||||
run: pg_isready -h postgres -p 5432
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: go test ./... -coverprofile=coverage.out
|
||||
|
||||
- name: Build binaries
|
||||
run: ./scripts/build.sh
|
||||
```
|
||||
|
||||
**Performance Improvements:**
|
||||
- ✅ **Faster execution**: Direct container execution without compose overhead
|
||||
- ✅ **Reliable caching**: Accurate dependency tracking with multi-file hash
|
||||
- ✅ **Simpler debugging**: Clear container boundaries and service networking
|
||||
- ✅ **Better portability**: Standard GitHub Actions patterns work across platforms
|
||||
|
||||
**Verification:**
|
||||
- ✅ **Workflow 465**: Both jobs completed successfully (2026-04-08)
|
||||
- ✅ **All tests passing**: Database connectivity working correctly
|
||||
- ✅ **Coverage reporting**: Badges updating automatically
|
||||
- ✅ **Binary builds**: Scripts executing properly in container environment
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
**Implementation Date:** 2026-04-08
|
||||
**Implementation Owner:** Arcodange Team
|
||||
**Approvers Needed:** @gabrielradureau
|
||||
**Reviewers:** @gabrielradureau
|
||||
Reference in New Issue
Block a user