docs and docker files #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install ruff | |
| run: pip install ruff | |
| - name: Run ruff (syntax and critical errors only) | |
| run: | | |
| ruff check . --select E9,F63,F7,F82 --no-fix | |
| echo "Syntax and critical error check: PASS" | |
| - name: Run ruff full check (informational) | |
| continue-on-error: true | |
| run: ruff check . --statistics 2>&1 | tail -25 | |
| test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| env: | |
| # Auth / JWT | |
| AUTH_SECRET_KEY: ci-test-secret-key-minimum-32-characters-long!! | |
| SECURITY_JWT_SECRET: ci-test-secret-key-minimum-32-characters-long!! | |
| USER_SERVICE_JWT_SECRET_KEY: ci-test-secret-key-minimum-32-characters-long!! | |
| # Encryption | |
| ENCRYPTION_MASTER_KEY: ci-test-encrypt-key-exactly-32ch | |
| USER_SERVICE_FIELD_ENCRYPTION_KEY: ci-test-encrypt-key-exactly-32ch | |
| FERNET_TOKEN_KEY: sp1gRbNPAdgva1NX4vYC3gZDNu--cUiGM5H9xhtltN8= | |
| FERNET_FIELD_KEY: aQyP7tOjb06jmhH0Ni3Y04CqcrzrnK_KnuurAOUWl4c= | |
| # Database | |
| POSTGRES_PASSWORD: ci_test_password | |
| USER_DB_PASSWORD: ci_test_password | |
| # Service Auth | |
| SERVICE_AUTH_SERVICE_SECRET: ci-test-service-secret-for-auth-32chars!! | |
| # Runtime | |
| ENVIRONMENT: test | |
| KAFKA_ENABLED: "false" | |
| LOG_LEVEL: WARNING | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| pip install pytest-mock pytest-asyncio httpx | |
| - name: Verify imports and syntax | |
| run: pytest tests/test_syntax_and_imports.py -x -q --no-header | |
| - name: Run alignment tests | |
| run: pytest tests/alignment/ -x -q --no-header | |
| - name: Run shared library tests | |
| continue-on-error: true | |
| run: | | |
| pytest tests/solace_common/ -x -q --no-header 2>&1 || true | |
| pytest tests/solace_security/ -x -q --no-header 2>&1 || true | |
| - name: Run service unit tests | |
| continue-on-error: true | |
| run: | | |
| pytest services/safety_service/tests/ -q --no-header --ignore=services/safety_service/tests/test_api.py 2>&1 || true | |
| pytest services/diagnosis_service/tests/ -q --no-header 2>&1 || true | |
| pytest services/therapy_service/tests/ -q --no-header 2>&1 || true | |
| pytest services/memory_service/tests/ -q --no-header 2>&1 || true | |
| pytest services/personality_service/tests/ -q --no-header 2>&1 || true | |
| - name: Run integration tests | |
| continue-on-error: true | |
| run: pytest tests/integration/ -q --no-header 2>&1 || true | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| service: | |
| - { context: "./services/user-service", name: "user-service" } | |
| - { context: "./services/safety_service", name: "safety-service" } | |
| - { context: "./services/notification-service", name: "notification-service" } | |
| - { context: "./services/diagnosis_service", name: "diagnosis-service" } | |
| - { context: "./services/memory_service", name: "memory-service" } | |
| - { context: "./services/therapy_service", name: "therapy-service" } | |
| - { context: "./services/personality_service", name: "personality-service" } | |
| - { context: "./services/orchestrator_service", name: "orchestrator-service" } | |
| - { context: "./services/analytics-service", name: "analytics-service" } | |
| - { context: "./services/config_service", name: "config-service" } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check Dockerfile exists | |
| id: check | |
| run: | | |
| if [ -f "${{ matrix.service.context }}/Dockerfile" ]; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| echo "::warning::No Dockerfile found for ${{ matrix.service.name }}" | |
| fi | |
| - name: Build Docker image | |
| if: steps.check.outputs.exists == 'true' | |
| run: | | |
| docker build \ | |
| --tag solace-ai/${{ matrix.service.name }}:ci \ | |
| ${{ matrix.service.context }} |