Initial commit: AAIP v1 #1
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: AAIP CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # ───────────────────────────────────────── | |
| # Python SDK + Backend Tests | |
| # ───────────────────────────────────────── | |
| test-python: | |
| name: Python SDK & Backend Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg15 | |
| env: | |
| POSTGRES_USER: aaip | |
| POSTGRES_PASSWORD: aaip_test | |
| POSTGRES_DB: aaip_test | |
| ports: ["5432:5432"] | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7-alpine | |
| ports: ["6379:6379"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install SDK dependencies | |
| working-directory: sdk/python | |
| run: pip install -e ".[dev]" | |
| - name: Lint SDK (ruff) | |
| working-directory: sdk/python | |
| run: ruff check aaip/ | |
| - name: Type check SDK (mypy) | |
| working-directory: sdk/python | |
| run: mypy aaip/ --ignore-missing-imports | |
| - name: Run SDK tests | |
| working-directory: sdk/python | |
| run: pytest tests/ -v --tb=short | |
| - name: Install backend dependencies | |
| working-directory: backend | |
| run: pip install -e ".[dev]" | |
| - name: Lint backend (ruff) | |
| working-directory: backend | |
| run: ruff check . | |
| - name: Run backend tests | |
| working-directory: backend | |
| env: | |
| DATABASE_URL: postgresql+asyncpg://aaip:aaip_test@localhost:5432/aaip_test | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| AAIP_DEV_MODE: "true" | |
| run: pytest tests/backend/ -v --tb=short | |
| # ───────────────────────────────────────── | |
| # TypeScript SDK | |
| # ───────────────────────────────────────── | |
| test-typescript: | |
| name: TypeScript SDK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: sdk/typescript/package.json | |
| - name: Install dependencies | |
| working-directory: sdk/typescript | |
| run: npm install | |
| - name: Type check | |
| working-directory: sdk/typescript | |
| run: npx tsc --noEmit | |
| - name: Build | |
| working-directory: sdk/typescript | |
| run: npm run build | |
| - name: Test | |
| working-directory: sdk/typescript | |
| run: npm test | |
| # ───────────────────────────────────────── | |
| # Go SDK | |
| # ───────────────────────────────────────── | |
| test-go: | |
| name: Go SDK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.21" | |
| - name: Vet | |
| working-directory: sdk/go | |
| run: go vet ./... | |
| - name: Test | |
| working-directory: sdk/go | |
| run: go test ./... | |
| - name: Build | |
| working-directory: sdk/go | |
| run: go build ./... | |
| # ───────────────────────────────────────── | |
| # Rust SDK | |
| # ───────────────────────────────────────── | |
| test-rust: | |
| name: Rust SDK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| sdk/rust/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('sdk/rust/Cargo.lock') }} | |
| - name: Clippy | |
| working-directory: sdk/rust | |
| run: cargo clippy -- -D warnings | |
| - name: Test | |
| working-directory: sdk/rust | |
| run: cargo test | |
| - name: Build | |
| working-directory: sdk/rust | |
| run: cargo build --release | |
| # ───────────────────────────────────────── | |
| # Java SDK | |
| # ───────────────────────────────────────── | |
| test-java: | |
| name: Java SDK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: temurin | |
| cache: maven | |
| - name: Build and Test | |
| working-directory: sdk/java | |
| run: mvn clean test | |
| # ───────────────────────────────────────── | |
| # Docker Build Check | |
| # ───────────────────────────────────────── | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: [test-python] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build backend image | |
| run: docker build -f backend/Dockerfile -t aaip-backend:ci . | |
| - name: Build frontend image | |
| run: docker build -f frontend/Dockerfile -t aaip-frontend:ci . | |
| # ───────────────────────────────────────── | |
| # Publish to PyPI (on tag) | |
| # ───────────────────────────────────────── | |
| publish-pypi: | |
| name: Publish Python SDK to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [test-python, test-typescript, test-go, test-rust] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Build package | |
| working-directory: sdk/python | |
| run: | | |
| pip install build | |
| python -m build | |
| - name: Publish to PyPI | |
| working-directory: sdk/python | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| pip install twine | |
| twine upload dist/* | |
| # ───────────────────────────────────────── | |
| # Publish to npm (on tag) | |
| # ───────────────────────────────────────── | |
| publish-npm: | |
| name: Publish TypeScript SDK to npm | |
| runs-on: ubuntu-latest | |
| needs: [test-python, test-typescript] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Install and build | |
| working-directory: sdk/typescript | |
| run: | | |
| npm install | |
| npm run build | |
| - name: Publish | |
| working-directory: sdk/typescript | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public |