Files
aptly/docker-compose.ci.yml
T
Nick Bozhenko 40ba104838 Add comprehensive CI/CD improvements and test coverage
This commit introduces major enhancements to the CI/CD pipeline and testing infrastructure:

CI/CD Improvements:
- Consolidated modern and legacy CI workflows into a single comprehensive pipeline
- Removed all publishing functionality from CI (no longer needed)
- Added 8 new advanced testing jobs for pull requests:
  * advanced-coverage: Detailed coverage analysis with base branch comparison
  * performance-profile: CPU and memory profiling with benchmarks
  * fuzz-test: Automated fuzz testing for supported packages
  * deep-analysis: Multiple static analysis tools (shadow, ineffassign, gosec, staticcheck)
  * mutation-test: Tests effectiveness of test suite on changed files
  * dependency-audit: Security vulnerabilities and outdated dependency checks
  * stress-test: Race detection with 100 iterations and parallel testing
  * test-report-summary: Aggregates all reports into a single PR comment
- Enabled RUN_LONG_TESTS by default for thorough testing
- Added automatic PR comment generation with all test results

Testing Infrastructure:
- Added comprehensive test files across all packages to improve coverage
- Implemented unit tests for previously untested packages
- Added race condition tests for concurrent operations
- Created integration tests for API endpoints
- Added storage backend tests (etcd, goleveldb)
- Implemented command-line interface tests

Local Testing Support:
- Added act configuration for testing GitHub Actions locally
- Created docker-compose.ci.yml for full CI environment simulation
- Updated CONTRIBUTING.md with detailed local testing instructions

Documentation Updates:
- Added comprehensive CI documentation to CONTRIBUTING.md
- Removed obsolete references to Travis CI
- Updated Go version requirements to 1.24
- Added act usage instructions and examples

Other Improvements:
- Updated .gitignore to exclude coverage reports and build artifacts
- Added test-act.yml workflow for testing act functionality
- Created CI_SUMMARY.md documenting all CI capabilities

These changes transform aptly's CI from a basic testing pipeline into a comprehensive quality assurance system that provides immediate feedback on code quality, performance, security, and test effectiveness.
2025-07-10 12:00:54 -04:00

88 lines
2.3 KiB
YAML

version: '3.8'
services:
# CI runner using act
ci-runner:
image: nektos/act:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .:/workspace
- act-cache:/root/.cache
working_dir: /workspace
environment:
- DOCKER_HOST=unix:///var/run/docker.sock
command: ["-W", "/workspace/.github/workflows/ci.yml", "-j", "test-unit", "--matrix", "go:1.24"]
# Etcd service for tests
etcd:
image: quay.io/coreos/etcd:v3.5.15
environment:
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCDCTL_API=3
ports:
- "2379:2379"
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 10s
timeout: 5s
retries: 5
# Azure storage emulator (Azurite)
azurite:
image: mcr.microsoft.com/azure-storage/azurite:latest
ports:
- "10000:10000" # Blob service
- "10001:10001" # Queue service
- "10002:10002" # Table service
command: "azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0"
# Local S3 (MinIO)
minio:
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
command: server /data --console-address ":9001"
volumes:
- minio-data:/data
# Run specific tests
test-runner:
image: catthehacker/ubuntu:act-latest
depends_on:
- etcd
- azurite
- minio
volumes:
- .:/workspace
working_dir: /workspace
environment:
- ETCD_ENDPOINTS=http://etcd:2379
- AZURE_STORAGE_ACCOUNT=devstoreaccount1
- AZURE_STORAGE_KEY=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
- AWS_ENDPOINT_URL=http://minio:9000
- AWS_ACCESS_KEY_ID=minioadmin
- AWS_SECRET_ACCESS_KEY=minioadmin
- RUN_LONG_TESTS=yes
command: |
bash -c "
# Wait for services
apt-get update && apt-get install -y netcat
while ! nc -z etcd 2379; do sleep 1; done
while ! nc -z azurite 10000; do sleep 1; done
while ! nc -z minio 9000; do sleep 1; done
# Install Go
apt-get install -y golang-go
# Run tests
go test -v -race ./...
"
volumes:
act-cache:
minio-data: