Merge pull request #15 from kokou-egbewatt/dev/kokou/ci #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: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'pyproject.toml' | |
| - '.github/**' | |
| - 'app/**' | |
| - 'data/**' | |
| - 'evaluation/**' | |
| - 'frontend/**' | |
| - 'pipelines/**' | |
| - 'scripts/**' | |
| - 'vector_store/**' | |
| pull_request: | |
| branches: [main, develop] | |
| types: [opened, reopened, synchronize] | |
| paths: | |
| - 'pyproject.toml' | |
| - '.github/**' | |
| - 'app/**' | |
| - 'data/**' | |
| - 'evaluation/**' | |
| - 'frontend/**' | |
| - 'pipelines/**' | |
| - 'scripts/**' | |
| - 'vector_store/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| - name: Install dev dependencies | |
| run: uv sync --group dev | |
| - name: ruff — check | |
| run: uv run ruff check . | |
| - name: ruff — format | |
| run: uv run ruff format --check . | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| env: | |
| EVAL_MOCK_LLM: "1" | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| - name: Install all dependencies | |
| run: uv sync --group dev --group pipelines | |
| - name: Cache HuggingFace models | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/huggingface | |
| key: hf-${{ runner.os }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: hf-${{ runner.os }}- | |
| - name: Build vector index | |
| run: uv run build_index | |
| - name: Guardrail tests | |
| run: uv run --group dev pytest -k "security" -v | |
| - name: Full evaluation suite | |
| if: ${{ env.OPENROUTER_API_KEY != '' }} | |
| run: uv run --group dev pytest -v | |
| docker: | |
| name: Docker build | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| tags: retail-intelligence:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |