|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [develop, main] |
| 6 | + pull_request: |
| 7 | + branches: [develop, main] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +jobs: |
| 13 | + lint: |
| 14 | + name: Lint |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + - uses: astral-sh/setup-uv@v4 |
| 19 | + with: |
| 20 | + version: "latest" |
| 21 | + - run: uv sync --all-extras |
| 22 | + - run: uv run ruff check . |
| 23 | + |
| 24 | + typecheck: |
| 25 | + name: Type Check |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + - uses: astral-sh/setup-uv@v4 |
| 30 | + with: |
| 31 | + version: "latest" |
| 32 | + - run: uv sync --all-extras |
| 33 | + - run: uv run mypy --strict src/ |
| 34 | + |
| 35 | + unit-tests: |
| 36 | + name: Unit Tests |
| 37 | + runs-on: ubuntu-latest |
| 38 | + strategy: |
| 39 | + matrix: |
| 40 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v4 |
| 43 | + - uses: astral-sh/setup-uv@v4 |
| 44 | + with: |
| 45 | + version: "latest" |
| 46 | + - run: uv python install ${{ matrix.python-version }} |
| 47 | + - run: uv sync --all-extras --python ${{ matrix.python-version }} |
| 48 | + - run: uv run pytest tests/unit/ -q |
| 49 | + |
| 50 | + integration-tests: |
| 51 | + name: Integration Tests |
| 52 | + runs-on: ubuntu-latest |
| 53 | + services: |
| 54 | + broker: |
| 55 | + image: devonartis/agentwrit:latest |
| 56 | + ports: |
| 57 | + - 8080:8080 |
| 58 | + env: |
| 59 | + AA_PORT: "8080" |
| 60 | + AA_BIND_ADDRESS: "0.0.0.0" |
| 61 | + AA_ADMIN_SECRET: ${{ secrets.AA_ADMIN_SECRET }} |
| 62 | + options: >- |
| 63 | + --health-cmd "wget --spider -q http://localhost:8080/v1/health" |
| 64 | + --health-interval 2s |
| 65 | + --health-timeout 3s |
| 66 | + --health-retries 10 |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + - uses: astral-sh/setup-uv@v4 |
| 70 | + with: |
| 71 | + version: "latest" |
| 72 | + - run: uv sync --all-extras |
| 73 | + - name: Run integration tests |
| 74 | + env: |
| 75 | + AGENTAUTH_BROKER_URL: http://localhost:8080 |
| 76 | + AGENTAUTH_ADMIN_SECRET: ${{ secrets.AA_ADMIN_SECRET }} |
| 77 | + run: uv run pytest -m integration -q |
| 78 | + |
| 79 | + secrets-scan: |
| 80 | + name: Secrets Scan |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v4 |
| 84 | + with: |
| 85 | + fetch-depth: 0 |
| 86 | + - uses: gitleaks/gitleaks-action@v2 |
| 87 | + env: |
| 88 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 89 | + |
| 90 | + no-ignored-tracked: |
| 91 | + name: No Ignored Files Tracked |
| 92 | + runs-on: ubuntu-latest |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v4 |
| 95 | + - name: Check for tracked files that should be ignored |
| 96 | + run: | |
| 97 | + tracked_ignored=$(git ls-files -i --exclude-standard 2>/dev/null || true) |
| 98 | + if [ -n "$tracked_ignored" ]; then |
| 99 | + echo "ERROR: These tracked files are in .gitignore:" |
| 100 | + echo "$tracked_ignored" |
| 101 | + exit 1 |
| 102 | + fi |
| 103 | + echo "Clean — no tracked files match .gitignore patterns." |
0 commit comments